Closed GuySartorelli closed 3 years ago
@gorriecoe @elliot-sawyer Any update on the status of this?
Sorry guys, overlooked this. I will have a look this weekend
Apologies for the delays on this, I've had a number of personal issues come up since my last comment!
This looks pretty good, but I do have a concern about backwards-compatibility. Will anyone relying on the old global method find that all link types are allowed until specifically configured, or are the same defaults in place? Should this be considered a breaking change?
@elliot-sawyer No worries! I hope everything is okay now.
Will anyone relying on the old global method find that all link types are allowed until specifically configured, or are the same defaults in place?
By default, i.e. without passing in a configuration array, the $this->owner->link_requirements
array will be empty in LinkExtension::updateTypes()
, LinkExtension::updateCMSFields()
, and LinkExtension::shouldDisplayTitleFields()
, so no modifications to the allowed types or display of title will be made. In other words whatever way they're currently using to choose what types are allowed will still work if no configuration is passed in.
Should this be considered a breaking change?
I don't think so. These changes shouldn't take any affect until a configuration array is passed into the constructor of the LinkField
or set via LinkField::setLinkConfig()
.
Happy with this, I'll merge now! Sorry again for the delay!
Addresses #1 Fixes #23 and #21 Also allows validating against a has_one Link using the RequiredFields validator.
The assumption at this stage is that for #23 you'll want to go with option 2 "Replace the unlink button on the has_one field with a delete button, and remove the option for linking to existing objects." but I can change it if you prefer another option.