i'm using

function mymodulename_flag_validate($action, $flag, $entity_id, $account, $skip_permission_check, $flagging) {

in my module. but i don't see any output when i click a flag/unflag link. so i think the hook never gets called.
or am i doing something wrong?


Category:support» bug
Status:Active» Postponed (maintainer needs more info)

You probably won't see any output via drupal messaging or print_r because it's AJAX.

Try using watchdog instead.

I'm experiencing the same issue with hook_flag and hook_unflag. I called watchdog() in these hooks and saw no log entries were made. I also switched the flag type to work as a normal link and drupal_set_message() did not return a system message.

Using 7.x-3.0-rc1

Did you clear your cache after adding those hooks?

Yes, many times.

Can you watchdog() at the point the hook is invoked?

Actually, I realized that I had read the hook name wrong, it's hook_flag_flag, not hook_flag. My brain removed the redundancy for me, how convenient. Sorry!