Problem/Motivation

For a node view, a field reference with format `Link label to the referenced entity` will have null #title and fail on builder and preview islands:

"Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/web/core/lib/Drupal/Core/Utility/LinkGenerator.php on line 203"

When debugging we see #title of the link on the render array is null

Steps to reproduce

Create a node display, for example articles on profile standard:

  • Add Field tags with config:
  • Field: Tags
  • Formatter: Label
  • Check Link label to the referenced entity

Uncheck `Link label to the referenced entity` and it's ok.

Debugging the render array, we have:

[
  "#entity" => Drupal\taxonomy\Entity\Term
  "#type" => "link"
  "#title" => null
  "#url" => Drupal\Core\Url
  "#options" => [...]
  "#cache" => [...]
]

Seems in UI Patterns ComponentElementBuilder::buildSource()
The getValue return the '#title' => null.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

mogtofu33 created an issue. See original summary.

pdureau’s picture

mogtofu33’s picture

mogtofu33’s picture

pdureau’s picture

Status: Active » Postponed (maintainer needs more info)

Is it the same as #3607927: Link label to the referenced entity not saved done on UI Patterns side?

pdureau’s picture

Status: Postponed (maintainer needs more info) » Active

Let's wait UI Patterns.

pdureau’s picture

Assigned: Unassigned » mogtofu33
Status: Active » Needs review

UI Patterns 2.0.20 has been released.

I have tested today, I am not reproducing the issue anymore. Do you?

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Fixed

I confirm, tested and fixed within ui_patterns 2.0.20.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.