In some scenarios, the logout action triggers this warning:
Notice: Trying to get property of non-object in entitycache_user_logout() (line 408 of /www/pfw/releases/20140912130110/profiles/pfwprofile/modules/contrib/entitycache/entitycache.module)
This happens because hook_user_logout is trying to be cache_clear $account without checking previously that this object exists and has this field.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 2341355-12.patch | 963 bytes | mcdruid |
| #10 | phpwarnings-when-logout-2341355-2.patch | 1023 bytes | parasolx |
| #7 | 2341355-php-notice-style.patch | 999 bytes | greggles |
| #3 | phpwarnings-when-logout-2341355-9162945.patch | 995 bytes | alexmoreno |
Comments
Comment #1
alexmoreno commentedComment #2
alexmoreno commentedFix attached.
Comment #3
alexmoreno commentedComment #4
recrit commentedComment #5
alansaviolobo commentedpatch works well.
Comment #6
hussainwebNitpick: Space after 'if' in this block and the next two.
Also, the condition could be simply collapsed to 'if (isset($account->uid))'
This can be fixed on commit.
Comment #7
gregglesHere's a reroll to add a space after the if and remove the parentheses which look unnecessary to me.
Comment #8
hussainwebThanks for the fixes. The above could just be
isset($account->uid), or if you care about 0 values,!empty($account->uid)Comment #9
Chris CharltonBump.
Comment #10
parasolx commentedAgree with hussainweb.
isset($account->uid)is enough to check either the uid is valid or not. So i just reattach the modified version with!empty(account->uid)Comment #11
damienmckennaThe latest patch needs to be reviewed.
Comment #12
mcdruid commentedI think @hussainweb was suggesting that the condition can be simply:
...which I think makes sense.
Comment #14
mcdruid commentedThanks everyone!