I was just curious if this is intended, but the Image Class field shows up on every field type, regardless if it's an image or not. In the screenshot you can see that I'm adding it to the link setting of a term reference. I've also seen it show up on entity references, body field, etc.

Comments

yannickoo’s picture

Status: Active » Closed (cannot reproduce)

Hey Kyle,

this is absolutely not intended but this is not an issue of Image Class module. You can see in code that only the image formatter is affected.

Please open an issue in the Field formatter settings issue queue but I cannot help you with this issue.

Sorry :(

Melissamcewen’s picture

I'm having this issue as well. Has anyone opened up a bug on Field formatter for this?

kyletaylored’s picture

dave reid’s picture

Status: Closed (cannot reproduce) » Active

The code in this module does not restrict its API alter hook to only the image formatter.

See http://drupalcode.org/project/field_formatter_settings.git/blob/refs/hea... and the context provided. This module should be checking if $context['instance']['display'][$context['view_mode']]['type'] = 'image' inside image_class_field_formatter_settings_form_alter() and image_class_field_formatter_settings_summary_alter().

@yannickoo: I have no clue why you'd say the issue is in the Field Formatter Settings module, considering you know the code more than others. It is an alter hook. Alter hooks get run on every module that implements the hook. You cannot assume that the alter hook only gets invoked in your module when you care, and not all times.

yannickoo’s picture

Sorry Dave for blaming your module D:

This was fixed with ba9626e now and everything is fine.

Dave, why you suggested to add an if inside the summary alter? The settings should not be available at that point, right?

yannickoo’s picture

Status: Active » Fixed
dave reid’s picture

Because the summary alter runs on *all* modules, so you must restrict adding or altering the summary *only* if the formatter you care about is being used. It looks like both hooks are fixed now though, so good!

yannickoo’s picture

Thanks again! Did not need that before because Linked Field is available for every field :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.