Loading src/Plugin/Field/FieldFormatter/TitleFormatter.php +6 −0 Changes for src/Plugin/Field/FieldFormatter/TitleFormatter.php: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\manage_display\Plugin\Field\FieldFormatter; use Drupal\Component\Render\HtmlEscapedText; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\Plugin\Field\FieldFormatter\BasicStringFormatter; use Drupal\Core\Form\FormStateInterface; Loading Loading @@ -35,6 +36,11 @@ class TitleFormatter extends BasicStringFormatter { $url = $parent->isNew() ? Url::fromRoute('<front>') : $parent->toUrl(); $text = Link::fromTextAndUrl($text, $url)->toString(); } else { // Workaround bug https://www.drupal.org/project/drupal/issues/3274778. $text = new HtmlEscapedText($text); } $output[] = [ '#type' => 'html_tag', '#tag' => $this->getSetting('tag'), Loading Loading
src/Plugin/Field/FieldFormatter/TitleFormatter.php +6 −0 Changes for src/Plugin/Field/FieldFormatter/TitleFormatter.php: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\manage_display\Plugin\Field\FieldFormatter; use Drupal\Component\Render\HtmlEscapedText; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\Plugin\Field\FieldFormatter\BasicStringFormatter; use Drupal\Core\Form\FormStateInterface; Loading Loading @@ -35,6 +36,11 @@ class TitleFormatter extends BasicStringFormatter { $url = $parent->isNew() ? Url::fromRoute('<front>') : $parent->toUrl(); $text = Link::fromTextAndUrl($text, $url)->toString(); } else { // Workaround bug https://www.drupal.org/project/drupal/issues/3274778. $text = new HtmlEscapedText($text); } $output[] = [ '#type' => 'html_tag', '#tag' => $this->getSetting('tag'), Loading