Fatal errors in entities that does not declare getFieldDefinitions method

Created on 13 December 2016, about 8 years ago
Updated 12 February 2024, about 1 year ago

Check if Entity has getFieldDefinitions method to prevent fatal errors in entities that does not declare the method. I have encountered this for example with Webform entities.

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇫🇮Finland msgph

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States sidgrafix

    +1
    Just ran into this with Drupal 10.2.3 and field_tokens 2.0.0-rc2 (wsod)

    Error: Call to undefined method Drupal\views\ViewExecutable::getFieldDefinitions() in field_tokens() ..and..
    Error: Call to undefined method Drupal\views\ViewExecutable::getFieldDefinitions() in field_tokens_tokens() (line 196 of /web/modules/contrib/field_tokens/field_tokens.tokens.inc).

    Patch fixed it, thank you.

Production build 0.71.5 2024