mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
Fixed relation for categories
This commit is contained in:
parent
6b8102894b
commit
9998db2e9e
@ -14,7 +14,7 @@ class RelationFieldsTestPage extends TestPage {
|
||||
function getCMSFields() {
|
||||
$fields = parent::getCMSFields();
|
||||
|
||||
$fields->addFieldToTab("Root.Content.CheckboxSet",
|
||||
$fields->addFieldToTab("Root.Content.CheckboxSet",
|
||||
new CheckboxSetField("CheckboxSet", "CheckboxSetField", TestCategory::map()));
|
||||
|
||||
/*
|
||||
|
@ -16,7 +16,7 @@ class TestCategory extends DataObject {
|
||||
*/
|
||||
static function map() {
|
||||
$categories = DataObject::get('TestCategory');
|
||||
if($categories) return $categories->toDropdownMap();
|
||||
if($categories) return $categories->map('ID', 'Title');
|
||||
else return array();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user