You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there are no allowable types of links to be created the LinkPicker will end up with a fatal error e.g.
[Emergency] Uncaught InvalidArgumentException: "SilverStripe\LinkField\Form\LinkField": Allowed types cannot be empty
This can be forced with LinkField::create('MyLink')->setAllowedTypes([]);, though it's also possible if the CMS user fails canCreate() checks on the allowed link types.
Since the CMS user has no control over this, we should allow and empty list of types and display a UI message on the frontend instead of an empty dropdown
ACs
There should be a message should be "Unable to create link"
There should not be a fatal PHP error arriving via ajax
If develop passes an empty array to setAllowedTypes() there should still be an exception because this is a developer error rather than a bunch of permission checks failing
If there are no allowable types of links to be created the LinkPicker will end up with a fatal error e.g.
[Emergency] Uncaught InvalidArgumentException: "SilverStripe\LinkField\Form\LinkField": Allowed types cannot be empty
This can be forced with
LinkField::create('MyLink')->setAllowedTypes([]);
, though it's also possible if the CMS user fails canCreate() checks on the allowed link types.Since the CMS user has no control over this, we should allow and empty list of types and display a UI message on the frontend instead of an empty dropdown
ACs
PR
The text was updated successfully, but these errors were encountered: