Loading src/TitleResolver.php +2 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Core\Url; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Route; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\FieldableEntityInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Component\Utility\Xss; Loading Loading @@ -61,7 +62,7 @@ class TitleResolver extends ControllerTitleResolver { } if ($entity !== NULL) { $alternative_title_field = $this->config->get(EasyBreadcrumbConstants::ALTERNATIVE_TITLE_FIELD); if ($entity->hasField($alternative_title_field) && !$entity->get($alternative_title_field) if ($entity instanceof FieldableEntityInterface && $entity->hasField($alternative_title_field) && !$entity->get($alternative_title_field) ->isEmpty()) { return Xss::filter($entity->get($alternative_title_field)->value); } Loading Loading
src/TitleResolver.php +2 −1 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Core\Url; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Route; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Entity\FieldableEntityInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Component\Utility\Xss; Loading Loading @@ -61,7 +62,7 @@ class TitleResolver extends ControllerTitleResolver { } if ($entity !== NULL) { $alternative_title_field = $this->config->get(EasyBreadcrumbConstants::ALTERNATIVE_TITLE_FIELD); if ($entity->hasField($alternative_title_field) && !$entity->get($alternative_title_field) if ($entity instanceof FieldableEntityInterface && $entity->hasField($alternative_title_field) && !$entity->get($alternative_title_field) ->isEmpty()) { return Xss::filter($entity->get($alternative_title_field)->value); } Loading