mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUG UploadField overwriteWarning isn't working in AssetAdmin
When UploadField overwriteWarning is enabled, no overwrite warning message for uploading file in non-root folder. This fix will let CMSFileAddController know the current folder when 'fileexists' AJAX request is called.
This commit is contained in:
parent
a0a5979eb6
commit
fd39faeefd
@ -103,6 +103,11 @@ class CMSFileAddController extends LeftAndMain {
|
||||
);
|
||||
$form->loadDataFrom($folder);
|
||||
|
||||
if($this->currentPageID()){
|
||||
// Make sure this controller know current folder when AJAX 'fileexists' is fired.
|
||||
$uploadField->setConfig('urlFileExists', Controller::join_links($uploadField->link('fileexists'), '?ID=' . $this->currentPageID()));
|
||||
}
|
||||
|
||||
$this->extend('updateEditForm', $form);
|
||||
|
||||
return $form;
|
||||
|
Loading…
x
Reference in New Issue
Block a user