Permalink
Browse files

BUGFIX Fixed ImageField->EditFileForm() to list subclasses of Image i…

…n 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
  • Loading branch information...
1 parent 4d665ce commit ceb27c4a41850e15aad683b0e4abfdc2d23f465c @chillu chillu committed Oct 15, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 forms/ImageField.php
@@ -28,7 +28,7 @@ public function FileTypeName() {
* @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);

0 comments on commit ceb27c4

Please sign in to comment.