| Project: | Chaos tool suite (ctools) |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
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
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| ctools-fix-field-formatter-helper.patch | 770 bytes | Idle | PASSED: [[SimpleTest]]: [MySQL] 68 pass(es). | View details | Re-test |
Comments
#1
Why doesn't this just use field_info_formatter_types() ?
#2
So... 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
<?phpfunction ctools_fields_get_field_formatter_info($fields) {
$info = array();
$field_info = field_info_formatter_types();
//...
?>
I think that likely does what I was looking to do at the time and I just couldn't find it.
Thoughts?
Eclipse
#3
crosspost with dave, that looks like consensus.
#4
Oh I wasn't aware of
field_info_formatter_types()- updated patch.#5
The last submitted patch, ctools-fix-field-formatter-helper-1571612-4.patch, failed testing.
#6
Re-roll