Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions

TreeDropDownField/DropDownField in DataObject does not save related SiteTree


4 Posts   691 Views


8 May 2013 at 2:36am (Last edited: 8 May 2013 2:36am), Community Member, 80 Posts

I just tested on a blank 3.0.5 installation and 3.1 beta 3.
If you have have a DataObject with related SiteTree like this...

private static $has_one = array(
"MySiteTree" => "SiteTree"

editing the DataObject... the DropDownField never remembers the selected Page. the same happens with TreeDropDownField.
It looks like it´s always saving the SiteTreeID of the Page that you are just editing in the CMS.

Is there any solution to this? or is it just a bug?


17 May 2013 at 6:36pm Community Member, 93 Posts

I'm having this experience too, with a days-old pull down of the 3.1 branch. Any chance you found an answer or a patch for this spierala? Cheers.


27 May 2013 at 11:07pm (Last edited: 27 May 2013 11:07pm), Community Member, 58 Posts

If I understand correctly...

public function getCMSFields() {
$fields = parent::getCMSFields();

$obiect = Obiect::get()->map('ID', 'Title');

$fields->addFieldToTab("Root.Main", new DropdownField('ObiectID', 'Płatność za', $obiect));

return $fields;

Sorry for my bad English


15 January 2014 at 1:18pm Community Member, 68 Posts

Did you ever get a solution for this for the TreeDropdownField - I'm getting the same issue