Images are incompatible with animated_gif module

Created on 11 June 2025, 3 days ago

Problem/Motivation

I have a custom field that can have multivalues of an image and a link.
When I try to add an image and save the node I get the following error:

Error: Call to undefined method stdClass::getValue() in animated_gif_preprocess_image_formatter() (line 19 of modules/contrib/animated_gif/animated_gif.module).

Steps to reproduce

Enable animated_gif and custom_field
Add a field with an image and a link.
(The image value column is called icon in my case)
https://git.drupalcode.org/project/animated_gif/-/blob/2.1.x/animated_gi...

Proposed resolution

getValue for an entity should return a similar value.
Possibly an issue with animated gif's implementation of preprocess_image_formatter

I'll create an issue over there too.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States nicxvan

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

Comments & Activities

  • Issue created by @nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    This can be likely closed, there is already an issue over there: πŸ› Error with module EntityBrowser Postponed: needs info .

    I'll leave this open while I test that.

  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    I don't think this would work with custom_field either way. That template_preprocess hook is assuming properties that don't exist in a custom_field. We would have to do our own version of this as a feature request and skip using that module from the way i see it.

  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    Also, I've had to deal with a client request like this before to support animated gifs and my recommendation on this is to use a designated media type for these specific requirements. Mixing animated gifs, svgs, etc... with normal images is just generally gonna lead to other bugs IMO. I know its easier said than done if there's already a bunch of values but its worth an update hook as far as I'm concerned ;)

Production build 0.71.5 2024