-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEW Globally disallow link types #219
NEW Globally disallow link types #219
Conversation
9fdda0e
to
1bc4b73
Compare
* | ||
* @throws ReflectionException | ||
*/ | ||
private function getLinkTypes(): array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is method is unused
1bc4b73
to
c8a71ba
Compare
use SilverStripe\LinkField\Models\PhoneLink; | ||
use SilverStripe\LinkField\Models\EmailLink; | ||
|
||
class AbstractLinkFieldTest extends SapphireTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I renamed this file and associated fixture files from LinkFieldTest
'Relation' => 'MyLink', | ||
], $res); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below this line is new test code, above this line is existing code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Tested locally. Just tiny enhancement.
README.md
Outdated
Developers can control the link types allowed for individual `LinkField`. The `setAllowedTypes` method only allow link types that have been provided as parameters. | ||
By default, all `Link` subclasses can be created by a `LinkField`. This includes any custom `Link` subclasses defined in your project or via a third party module. | ||
|
||
If you wish to globally disable one of the default `Link` subclasses for all `LinkField` instances, then this can be done using the following YAML configuration, using the FQCN of the relevant default `Link` subclass you wish to disable: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you wish to globally disable one of the default `Link` subclasses for all `LinkField` instances, then this can be done using the following YAML configuration, using the FQCN of the relevant default `Link` subclass you wish to disable: | |
If you wish to globally disable one of the default `Link` subclasses for all `LinkField` instances, then this can be done using the following YAML configuration, using the FQCN (Fully-Qualified Class Name) of the relevant default `Link` subclass you wish to disable: |
It would be nice to clarify, since we have not used this abbreviation before in the text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
c8a71ba
to
0c0cdaa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Locally tested.
Issue #212