mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #4754 from tractorcow/pulls/3.2/upload-fixes
BUG prevent UploadField edit form generation for Folders
This commit is contained in:
commit
c2c78c445e
@ -1432,6 +1432,10 @@ class UploadField_ItemHandler extends RequestHandler {
|
|||||||
*/
|
*/
|
||||||
public function EditForm() {
|
public function EditForm() {
|
||||||
$file = $this->getItem();
|
$file = $this->getItem();
|
||||||
|
if(!$file) return $this->httpError(404);
|
||||||
|
if($file instanceof Folder) return $this->httpError(403);
|
||||||
|
if(!$file->canEdit()) return $this->httpError(403);
|
||||||
|
|
||||||
// Get form components
|
// Get form components
|
||||||
$fields = $this->parent->getFileEditFields($file);
|
$fields = $this->parent->getFileEditFields($file);
|
||||||
$actions = $this->parent->getFileEditActions($file);
|
$actions = $this->parent->getFileEditActions($file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user