Skip to content
Snippets Groups Projects

Issue #3151609: Use entity title for link text when link text is empty.

Open Issue #3151609: Use entity title for link text when link text is empty.

Closes #3151609

Merge request reports

Members who can merge are allowed to add commits.

Merge request pipeline #513134 passed

Merge request pipeline passed for 4fca7b86

Code Quality is loading
Test summary results are being parsed
Ready to merge by members who can write to the target branch.
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
33 35 */
34 36 protected $pathValidator;
35 37
38 /**
39 * The entity type manager service.
40 *
41 * @var \Drupal\Core\Entity\EntityTypeManagerInterface
42 */
43 protected $entityTypeManager;
  • Manish Sharma added 1 commit

    added 1 commit

    Compare with previous version

  • 180 180 $url = $this->buildUrl($item);
    181 181 $link_title = $url->toString();
    182 182
    183 // Use the entity title for the link text for internal URLs only.
    184 if (empty($settings['url_only']) && !$url->isExternal() && empty($item->title) && $url->isRouted()) {
    185 $route_parameters = $url->getRouteParameters();
    186 if (!empty($route_parameters)) {
    187 foreach ($route_parameters as $entity_type => $id) {
    188 if ($this->entityTypeManager->hasDefinition($entity_type)) {
    189 if ($entity = $this->entityTypeManager->getStorage($entity_type)->load($id)) {
    190 $translated_entity = $entity->hasTranslation($langcode) ? $entity->getTranslation($langcode) : $entity;
  • Klemen Brodej added 1 commit

    added 1 commit

    • 4fca7b86 - Issue #3151609: Add instanceof for Translatable and Fieldable entities

    Compare with previous version

  • Please register or sign in to reply
    Loading