I have a page with a $has_many relationship to VideoSnippets. VideoSnippets class extends from DataObject and includes a $has_one relationship back to my page. It all works fine, but in the CMS when I go to my page, and click the big green button to add a VideoSnippet to the page I am on, the droplist for the page (relationship) is blank. I would expect this to be populated since it knows (shows in the bread crumbs) the page I clicked the Add on.
The droplist for the relationship is blank in the form, and hitting save will select the correct page. However is there a way I can have it already selected, or, even better, don't even show the relationship droplist?
You can easily remove the field by adding $fields->removeByName('PageID'); into the getCMSFields function of your DataObject.
I have been wondering why this field get's shown, but i guess it has to do with the fields be generated by the form scaffolidng.
The really weird part is that it will not allow you to actually change the relation to another page, if you try, it just sets the same page again.