It would be nice if this was compatible with Panels. I have also tried to use the rendered field in Panels, with a view mode setting this field, but that didn't work either.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yannickoo’s picture

Okay, seems to be an issue with Field formatter settings API because Image class module also has that problem (#1928926: Panels).

yannickoo’s picture

Title: Field formatter not appearing as option in Panels » Field formatter settings not appearing as option in Panels
Project: Linked Field » Field formatter settings
Version: 7.x-1.8 » 7.x-1.x-dev

It seems that additional field formatter settings are not appearing in Panels.
This has been reported for Linked Field and Image class module (#1928926: Panels).

Let us find out what we can do that they also appear in Panels :)

Alan D.’s picture

Title: Field formatter settings not appearing as option in Panels » Field formatter settings with CTool content_type entity_field plugin (Panels integration)

The root module is actually CTools that provides the content_type plugins.

I haven't tried, but it would probably be trivial to invoke the non-existent field hooks there and get the additional settings added. Someone would just have to convince Earl that this is a worthwhile feature....

Cross post: #1589814: Is hook_form_alter possible for field formatter forms?

Alan D.’s picture

Dave Reid’s picture

Or if we know what form we can alter, we can invoke it in Field formatter settings ourselves.

yannickoo’s picture

Project: Field formatter settings » Chaos Tool Suite (ctools)
Category: feature » task

I would move this to the Ctools issue queue because they should alter the Field Formatter Settings because this is also needed for D8.

We have to add the drupal_alter in the ctools_fields_get_field_formatter_settings_form function.

Lukas von Blarer’s picture

I referred from #2020445: Not available in panelizer. I also have this issue with Panelizer and therefore also with Panels. This were my findings:

To make my issue more clear I tried some more debugging... The issue is not only for text fields, but for all field types when using Panelizer. I realized that the module field_multiple_limit which uses field_formatter_settings as well and works perfectly. The weird thing is that hook_field_formatter_settings_form_alter doesn't seem to be called in both modules when using Panelizer. But why is it still working for field_multiple_limit? And besides that I dont see any big differces in the usage of the hooks these modules implement. What can we do to fix this?

Why is field_multiple_limit working? What does it do differently?

Lukas von Blarer’s picture

field_injector has got the same issue.

Lukas von Blarer’s picture

How do I have to call drupal_alter() in there? Can we use a alter hook that already exists? Or do we have to introduce a new one?

WorldFallz’s picture

i just stumbled across this as a result of empty_fields not working with panels. I'm happy to roll a patch, and tried the suggestion in #6, but it doesn't seem to have any effect.

anyone have a work around any idea where I should start for a patch?

Dave Reid’s picture

Category: task » feature
Status: Active » Needs review
FileSize
1000 bytes

Let's try this patch.

Dave Reid’s picture

Anyone able to review and test this?

WorldFallz’s picture

yep... just forgot to post back. The options appear, though the ajax show/hide seems to be broken-- at least for empty_fields settings. Also, the actual empty_fields settings don't seem to be actually having any effect. I'm thinking both of those issues likely belpong to empty_fields, but I don't have any other field settings altering modules install to test. know of any good candidates I should test?

mate2’s picture

i've tried the patch from #11 with empty_fields (7.x-2.0) and panels (7.x-2.0) module
and now i can edit the empty display options at formatter styles, but not for all field types.
edit works for: entity reference field, date field.
but edit form is not displayed for: term reference field, long text field, Long text and summary field.
therefore i set the "Empty display options" in admin/structure/types/manage/content/display and via panel ui, but i can't see any empty fields.
i've not installed Panelizer.

JKingsnorth’s picture

Issue summary: View changes
Status: Needs review » Needs work
Alan D.’s picture

The patch probably fails in some cases, as prior to the alter, many fields will not have a form, as the alter creates the only available fields. Does not fully explain results from #14 though :(

magicmyth’s picture

Status: Needs work » Needs review
FileSize
1010 bytes

The patch from #1928054-11: Field formatter settings with CTool content_type entity_field plugin (Panels integration) does partly solve the specific issue of allowing modifications of the Field UI formatter setting form from other modules but is slightly miss-placed. It will fail on formatters that have no settings by default but gained settings from other modules. I've attached a patch that fixes this.

Note that the patch is solving the specific issue of CTools not allowing field formatter setting forms to be altered. Accessing the stored field values is IMHO a separate issue as I imagine most modules depend on looking up the field instance settings based on entity view mode which will not work with something like CTools because the field settings are not stored that way. I've provided a solution for the module Field Formatter Class #2227133: Make CTools compatible with hook_field_attach_view_alter() which might be the kind of solution other modules can use?

SocialNicheGuru’s picture

no longer applies cleanly to the latest dev version (8/22/14)

magicmyth’s picture

@SocialNicheGuru I just checked the patch against both dev and git and it applied just fine. Are you sure you do not have any other patches applied that may conflict?

DYdave’s picture

Hi guys,

I would like to confirm that I have just applied the patch from #17 cleanly, without any problem against ctools-7.x-1.x at ae66d65.

Additionally, I would like to mention the patch seems to work as expected and appears to provide support for the integration between ctools and Field formatter settings, thus fixing the issue #2329895: Display Suit Dynamic fields: Integration between Grid Field Formatter (based on Field formatter settings) and Display Suite (Panels/ctools based dialogs and forms).
For more details, see referencing issue #2329895: Display Suit Dynamic fields.

Thanks very much to all for posting this issue and the corresponding patch.
Cheers!

SocialNicheGuru’s picture

it does apply cleanly and brand new install. sorry for the noise.

Status: Needs review » Needs work

The last submitted patch, 17: ctools-field-formatter-settings-form-alter-1928054-16.patch, failed testing.

Lukas von Blarer’s picture

Works for me as well.

mrjmd’s picture

Status: Needs work » Needs review
FileSize
1018 bytes

Here's a re-roll with a spelling fix.

yannickoo’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
199.92 KB

Cool, thanks mrjmd :) I tested that patch and Linked Field seems to work inside a view when adding a new field.

travisc’s picture

any chance of getting this into 1.6?

mrjmd’s picture

mrjmd’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.01 KB

Discussed this with jappery, it looks like the alter should happen inside of the if ($settings_form) as in #11. The version I rerolled based on #17 would product weird results if $settings_form came back NULL.

Here's a new patch.

yannickoo’s picture

Status: Needs review » Reviewed & tested by the community

Makes sense :)

japerry’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +SprintWeekend2015

That looks better! Fixed.

  • japerry committed df3198e on 7.x-1.x authored by Dave Reid
    Issue #1928054 by mrjmd, yannickoo, Dave Reid, magicmyth: Field...

Status: Fixed » Closed (fixed)

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