Problem/Motivation
Currently ctools_fields_get_field_formatter_info()
invokes hook_field_formatter_info
, processes the output and then invokes hook_field_formatter_info_alter
.
Since the processing checks if a specific field type is supported by the field formatter changes of the supported field types by using hook_field_formatter_info_alter
won't have any effect.
Proposed resolution
Invoke hook_field_formatter_info_alter
right after the invocation of hook_field_formatter_info
and before processing the output.
Remaining tasks
Verify that this patch doesn't change an order made intentionally.
At the moment I don't see any reason why the alter hook should be invoked after the output processing.
If there needs to be an alter hook for the processed output I think it should be ctools specific.
User interface changes
none
API changes
none
Comment | File | Size | Author |
---|---|---|---|
#6 | ctools-fix-field-formatter-helper-1571612-6.patch | 768 bytes | das-peter |
#4 | ctools-fix-field-formatter-helper-1571612-4.patch | 774 bytes | das-peter |
ctools-fix-field-formatter-helper.patch | 770 bytes | das-peter |
Comments
Comment #1
Dave ReidWhy doesn't this just use field_info_formatter_types() ?
Comment #2
EclipseGc CreditAttribution: EclipseGc commentedSo... I think this is probably me who wrote this initially (not for sure) and I'm wondering if we might not be better off with just
I think that likely does what I was looking to do at the time and I just couldn't find it.
Thoughts?
Eclipse
Comment #3
EclipseGc CreditAttribution: EclipseGc commentedcrosspost with dave, that looks like consensus.
Comment #4
das-peter CreditAttribution: das-peter commentedOh I wasn't aware of
field_info_formatter_types()
- updated patch.Comment #6
das-peter CreditAttribution: das-peter commentedRe-roll
Comment #8
Leksat CreditAttribution: Leksat at Amazee Labs commentedThe file_image_formatters module allows to use image formatters on file fields and vice versa. Before this patch it was not possible to save the formatter settings, they just got lost.
After applying the patch to ctools, it works like a charm!
Comment #10
japerryYah this seems like a simple API mismatch. Committed.