From aae6b2b2966db9b6b41621a3ce6e8c65337ba2c9 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 11 Oct 2013 00:27:14 +0200 Subject: [PATCH] Avoid encoded HTML breadcrumbs --- code/model/SiteConfig.php | 6 +++++- code/model/SiteTree.php | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/code/model/SiteConfig.php b/code/model/SiteConfig.php index c80539de..cc1ec1aa 100644 --- a/code/model/SiteConfig.php +++ b/code/model/SiteConfig.php @@ -53,7 +53,11 @@ class SiteConfig extends DataObject implements PermissionProvider { */ public function getCMSFields() { - $groupsMap = Group::get()->map('ID', 'Breadcrumbs')->toArray(); + $groupsMap = array(); + foreach(Group::get() as $group) { + // Listboxfield values are escaped, use ASCII char instead of » + $groupsMap[$group->ID] = $group->getBreadcrumbs(' > '); + } asort($groupsMap); $fields = new FieldList( diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 42b3a1ee..53567dc0 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -1978,7 +1978,11 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid * @return FieldList */ public function getSettingsFields() { - $groupsMap = Group::get()->map('ID', 'Breadcrumbs')->toArray(); + $groupsMap = array(); + foreach(Group::get() as $group) { + // Listboxfield values are escaped, use ASCII char instead of » + $groupsMap[$group->ID] = $group->getBreadcrumbs(' > '); + } asort($groupsMap); $fields = new FieldList(