mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02: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
@ -102,6 +102,11 @@ class CMSFileAddController extends LeftAndMain {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
$form->loadDataFrom($folder);
|
$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);
|
$this->extend('updateEditForm', $form);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user