Closed (fixed)
Project:
Fasttoggle
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jan 2013 at 21:47 UTC
Updated:
21 Jan 2013 at 02:50 UTC
There's a lot more hook_user ops than 'categories', 'register', "validate", 'view' and it looks like it's only relative for 'view', it runs fasttoggle_user on every op but 'categories', 'register', "validate" (update, after update, insert)
Also !empty > array_key_exists performance wise tmk and using $user as a local variable name is bad coding standards wise
Untested
| Comment | File | Size | Author |
|---|---|---|---|
| fasttogle_hook_user.patch | 1.51 KB | hefox |
Comments
Comment #1
nigelcunningham commentedThanks for the patches.
How about just
(Will minimise the diff to that and the array_key_exists => empty change).
Comment #2
hefox commentedThe diff also accounts for $type => $op and $user => $account change, and lower down where - if ($type == "view" && !empty($links)) { would need to change also.
imo it's usually better to do if $op == something instead of != return as it cleaner later on when needing to add a condition that uses a different $op, however I personally don't feel strongly about it either way.
Comment #3
nigelcunningham commentedTa, once again!