Error if node doesn't have the selected field

Created on 24 June 2025, about 2 months ago

When I try to use this functionality on a node bundle that doesn't have the selected image field, I get an error

InvalidArgumentException: Field is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 616 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).

I'll add a patch that checks to ensure the field exists on the bundle or falls back to the fallback image.

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇨🇦Canada dshields

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

Comments & Activities

  • Issue created by @dshields
  • 🇨🇦Canada dshields

    This gets me past the error.

    As mentioned in another active ticket, per-bundle configs would be a lovely improvement to this very useful module. Maybe I can take a stab at extending it in that manner, but I don't have the bandwidth at this time.

Production build 0.71.5 2024