Problem/Motivation
The formatters title field description says "Will be used as the link title unless one has been set on the field. Supports token replacement."
However, when a title is entered, the formatter still prints the title defined in the field formatter.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|
Issue fork micon-3537389
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
thomas.frobieterComment #3
thomas.frobieterOkay I got the cause, but this needs a backend programmer.
Check this: https://git.drupalcode.org/project/micon/-/blob/2.x/modules/micon_link/src/Plugin/Field/FieldFormatter/MiconLinkFormatter.php?ref_type=heads#L170
Inside the foreach I printed:
Result:

So from my point of view it needs to be something like this:
EDIT: My fix is incorrect because if the link title override field has no value, $item['#title'] is not empty; it falls back on the URL instead.
Comment #4
anybodyCan't we just look up, how the other link (it) formatters solve it? This isn't a dedicated feature for us, right?
So we should simply use the same logic or am I missing something?
Comment #5
thomas.frobietermicon_linkit and micon_linkit_attributes are form field widgets, not display formatters? So, as far as I can see, this is the only formatter with this logic (in this module).
Comment #8
lrwebks commentedWorks as expected now. The additional check with the URI is necessary, as the link module shows the link URI as the fallback link text when either nothing was entered in the entity form or the link text was disabled in the field settings.
Comment #9
anybodyComment #10
thomas.frobieterOkay all done and tested.
Comment #11
anybodyThanks, merged!
Comment #13
fjgarlin commented(Updating to resolve Drupal.org issue index issue, please disregard)