I have two (separate) DataObject subclasses, each containing a $has_one like this:
private static $has_one = array( 'PageLink'=>'SiteTree', 'Picture'=>'Image' );
and in getCMSFields,
TreeDropdownField::create('PageLinkID', 'Optional page to link to', 'SiteTree'),
but in the CMS, it always appears as readonly (i.e. just the name of what it's linking to, and viewing source shows "treedropdownfield_readonly"). Even when I explicitly make it not readonly afterwards.
What's really weird is that if I change $has_one to
private static $has_one = array( 'PageLink'=>'SiteTree', 'Dummy'=>'SiteTree', 'Picture'=>'Image' );
it is no longer readonly (but creating a TreeDropdownField for Dummy is readonly). Any ideas what the problem could be? This is driving me partially insane.
On a secondary note, having
in my $summary_fields doesn't make it display, but using a custom method does. Is this related?
All help is greatly appreciated.