#145 - Wrong hook name

Description

So I was working on a cool new plugin (top secret xD) and found a bug, actually two. When I add hooks there's a hook named "handler_tickets" but in handlers/tickets.php there's [code]($hook = FishHook::hook('tickets_handler')) ? eval($hook) : false;[/code]

also in line 204 of the same file there's [code]($hook = FishHook::hook('tickets_columns')) ? eval($hook) : false;[/code] which is not on the hooks list.

Activity

  1. arturo182 commented
    16 years ago

    Maybe it would be better if instead of using string names you'd use defines, that way code wouldn't be less readable but it would be harder to make mistakes.

    Something like: [code]define('HOOK_GLOBALS', 1);[/code]

  2. Jack commented
    16 years ago

    So instead of like [code]($hook = FishHook::hook('hook_name')) ? eval($hook) : false;[/code] it would be [code]($hook = FishHook::hook('HOOK_NAME')) ? eval($hook) : false;[/code]

    or did I not understand? (tired >_>)

  3. Jack closed this ticket as Fixed
    16 years ago

    Fixed invalid name and added missing location.

  4. arturo182 commented
    16 years ago

    no, it would be: [code]($hook = FishHook::hook(HOOK_NAME)) ? eval($hook) : false;[/code]

    and that way if you misspell it there will be a warning (or error I don't remember right now) telling you that such define does not exist.

Status

Fixed
Jack
Normal

Details

Defect
2.0
Plugins
0.4
Minor

Tracking

arturo182
16 years and 8 months ago
12 years and 12 months ago
0
-
-