Call to undefined method Drupal\node\Entity\NodeType::hasTranslation()

Created on 14 February 2024, 9 months ago

Problem/Motivation

Error : Call to undefined method Drupal\node\Entity\NodeType::hasTranslation() in Drupal\ui_patterns_field_formatters\Plugin\Field\FieldFormatter\PatternFormatter->viewElements() (line 222 in (...) modules/contrib/ui_patterns_field_formatters/src/Plugin/Field/FieldFormatter/PatternFormatter.php).

Steps to reproduce

Create a block to display the content type of a search result.

Proposed resolution

Check if the entity is translatable before calling hasTranslation().

🐛 Bug report
Status

Active

Version

1.8

Component

Code

Created by

🇫🇷France seb_r

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024