-
Notifications
You must be signed in to change notification settings - Fork 32
Issue 137 - Allow formatter to set url_only and url_plain. #138
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
Conversation
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.
As is, this throws an error:
PHP Fatal error: Could not check compatibility between
Drupal\\controlled_access_terms\\Plugin\\Field\\FieldFormatter\\AuthorityLinkFormatter::settingsForm(array $form, Drupal\\controlled_access_terms\\Plugin\\Field\\FieldFormatter\\FormStateInterface $form_state)
andDrupal\\link\\Plugin\\Field\\FieldFormatter\\LinkFormatter::settingsForm(array $form, Drupal\\Core\\Form\\FormStateInterface $form_state)
, because classDrupal\\controlled_access_terms\\Plugin\\Field\\FieldFormatter\\FormStateInterface
is not available in/var/www/html/drupal/web/modules/contrib/controlled_access_terms/src/Plugin/Field/FieldFormatter/AuthorityLinkFormatter.php
on line 35
Add the missing use Drupal\Core\Form\FormStateInterface;
statement.
Looks like this is an old bug that we didn't realize because we didn't have the option to use it before now. if (!empty($settings['url_only']) && !empty($settings['url_plain'])) {
$element[$delta] = [
'#plain_text' => $link_title,
]; should be (untested) if (!empty($settings['url_only']) && !empty($settings['url_plain'])) {
$element[$delta] = [
'#plain_text' =>$url;
]; |
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.
👍
GitHub Issue: #137
Release pull requests, etc.)
What does this Pull Request do?
Puts the "URL only" and "Show URL as plain text" checkboxes on the field formatter settings page for authority links
What's new?
(i.e. Regeneration activity, etc.)? No
How should this be tested?
A description of what steps someone could take to:
url_only
orurl_plain
. #137.Additional Notes:
Any additional information that you think would be helpful when reviewing this
PR.
Interested parties
Tag (@ mention) interested parties or, if unsure, @Islandora/committers