Posted by 30equals on December 5, 2012 at 12:03am
2 followers
| Project: | Field formatter conditions |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I implemented this hook, together with the hook_ffc_conditions_info, etc.. in a custom module, but i noticed that my hook didn't get executed.
The problem is the following:
on line #97 of ffc.module, the fuction name is the following :
$callback = 'ffc_condition_execute_' . $condition['condition'];
if (function_exists($callback)) {
$callback($build, $field_name, !empty($condition['configuration']) ? $condition['configuration'] : '', $context);
}and that's the only function which gets called, no module hooks get called as well.
Imo, there are two solutions: change the hook name to ffc_condition_execute_CONDITION like you did with ffc_condition_form_CONDITION
or make the hook work ;)
Comments
#1
Patch for the second solution: make the hook work.
#2
Hmm, it's actually not a real hook indeed, it's an automatically generated callback function, both for form or conditions.
The reason why form callbacks now work in a different file is because the info file is loaded during the form alter anyway, execute callbacks need to live in the main module file - for now, and I'd rather let it be that way for now, although I agree it might be confusing. Let me sleep about it a little more :)
#3
Changed the api file, it was confusing indeed.
#4
Committed and pushed (the bot might return red as I've pushed already).
#5