Problem/Motivation
The recent change to resolve issue 3274488 doesn't seem to work with non-fieldable entities such as Webforms.
When installing the Shorthand module on a site using Webform, we encountered the following error:
Error: Call to undefined method Drupal\webform\Entity\Webform::getFieldDefinitions() in shorthand_metatags_alter() (line 116 of modules/contrib/shorthand/shorthand.module).
Proposed resolution
Adding an additional condition on line 116 to check whether the entity implements FieldableEntityInterface seems to fix. (Approach borrowed from this fix, found while researching the issue.)
A patch containing this change is attached.
| Comment | File | Size | Author |
|---|---|---|---|
| check_for_fieldableentityinterface.patch | 628 bytes | ian-dcuk |
Comments
Comment #2
vladimirausComment #3
robcarrThanks for the patch - resolved the problem (below) for me, although I was using latest release - so line numbering different - and my error was based on Views [another non-fieldable entity]
Comment #5
vladimirausThank you! Commited! Cheers! 🍺