diff --git a/src/Security/Group.php b/src/Security/Group.php index cfa57c237..eb72fbfe3 100755 --- a/src/Security/Group.php +++ b/src/Security/Group.php @@ -96,6 +96,16 @@ class Group extends DataObject return $doSet; } + + private function getDecodedBreadcrumbs() + { + $list = Group::get()->exclude('ID', $this->ID); + $groups = ArrayList::create(); + foreach ($list as $group) { + $groups->push(['ID' => $group->ID, 'Title' => $group->getBreadcrumbs(' ยป ')]); + } + return $groups; + } /** * Caution: Only call on instances, not through a singleton. @@ -116,7 +126,7 @@ class Group extends DataObject $parentidfield = DropdownField::create( 'ParentID', $this->fieldLabel('Parent'), - Group::get()->exclude('ID', $this->ID)->map('ID', 'Breadcrumbs') + $this->getDecodedBreadcrumbs() )->setEmptyString(' '), new TextareaField('Description', $this->fieldLabel('Description')) ),