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

30equals’s picture

Status: Active » Needs review
StatusFileSize
new1018 bytes

Patch for the second solution: make the hook work.

swentel’s picture

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 :)

swentel’s picture

StatusFileSize
new1.03 KB

Changed the api file, it was confusing indeed.

swentel’s picture

Status: Needs review » Fixed

Committed and pushed (the bot might return red as I've pushed already).

swentel’s picture

Status: Fixed » Closed (fixed)