The double check on $args is actually incorrect and causes a notice on PHP 5.3/E_STRICT if $args is not passed.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 0001-Issue-2055775-by-fgm-Fixed-incorrect-check-in-uc_pro.patch | 997 bytes | fgm |
The double check on $args is actually incorrect and causes a notice on PHP 5.3/E_STRICT if $args is not passed.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 0001-Issue-2055775-by-fgm-Fixed-incorrect-check-in-uc_pro.patch | 997 bytes | fgm |
Comments
Comment #1
fgmPatch actually removes the useless first check causing the notice.
Comment #2
longwaveAgreed that the check is unnecessary, but what is the actual notice you see? If $args is not passed then the warning is surely from the function definition, and the hook documentation says $args is not optional. And if $args is empty why would isset($args[0]) generate a warning but isset($args[0]->nid) does not?
Comment #3
tr commentedPHP notices in 6.x are minor. What are the steps to reproduce this one?
Comment #4
fgmBad formulation from me: the check is useless, the notice happens on an earlier version (6.x-2.2) where the unnecessary check was not yet wrapped in a isset() as it is now. It looked like this:
The notice happens on the
$args[0]because$argsis justarray(), which does not have a 0 index, when invoked fromdrupal_retrieve_form()without additional args on the upstreamdrupal_get_form(), I guess.Comment #5
longwaveIn that case it's no longer a bug but a minor improvement, thanks for clarifying.
Comment #6
longwaveCommitted to both branches.