mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed ImageField->EditFileForm() to list subclasses of Image in tree dropdown (fixes #5708, thanks keeny) (from r106671)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112533 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
4d665ce268
commit
ceb27c4a41
@ -28,7 +28,7 @@ class ImageField extends FileIFrameField {
|
||||
* @return Form
|
||||
*/
|
||||
public function EditFileForm() {
|
||||
$filter = create_function('$item', 'return ($item->ClassName=="Folder" || $item->ClassName=="Image");');
|
||||
$filter = create_function('$item', 'return (in_array("Folder", ClassInfo::ancestry($item->ClassName)) || in_array("Image", ClassInfo::ancestry($item->ClassName)));');
|
||||
|
||||
$form = parent::EditFileForm();
|
||||
$form->dataFieldByName('ExistingFile')->setFilterFunction($filter);
|
||||
|
Loading…
Reference in New Issue
Block a user