From ceb27c4a41850e15aad683b0e4abfdc2d23f465c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 15 Oct 2010 03:02:17 +0000 Subject: [PATCH] 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 --- forms/ImageField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forms/ImageField.php b/forms/ImageField.php index c3424012f..6ce20f082 100755 --- a/forms/ImageField.php +++ b/forms/ImageField.php @@ -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);