When I upgraded nodeaccess_userreference to version 6.x-3.0, I started seeing the following warning with devel_node_access enabled:
Warning: implode() [function.implode]: Invalid arguments passed in nodeaccess_userreference_node_access_explain() (line 227 of /home/paul/work/git/events/sites/all/modules/nodeaccess_userreference/nodeaccess_userreference.module).
The problem is the following line:
$do = implode('/', $ops);
If $ops is empty (because there were no grants), an empty array is passed to implode(). PHP 5.3 does not like this.
Thank you for this module, by the way. Even with this minor error, it works well for my application.
Comment | File | Size | Author |
---|---|---|---|
#1 | php-warning-implode-1093622-1.patch | 2.04 KB | paulmckibben |
Comments
Comment #1
paulmckibbenPatch attached. Please let me know if I need to change anything. Thanks again!
Comment #2
paulmckibbenOh, by the way, the above patch is against the 6.x-3.x branch in git, not on the 6.x-3.0 code. Sorry!
Comment #3
danielb CreditAttribution: danielb commentedWhy not just initialise $ops to array() ?
I disagree with this assessment. Empty arrays should be OK in implode(). Variables that don't exist, however, are not OK.
Comment #4
danielb CreditAttribution: danielb commentedI've committed that, it should get rid of the error.
Comment #5
paulmckibbenYes, much simpler. With your one-line change, the error is gone. However, the resulting "explain" strings are still funny, because the $do string is empty. Example: "All users may this node".
I'll be glad to write a different issue for this; just let me know. Definitely not critical, as only developers will ever see these strings.
Again, thank you for this valuable module!
Comment #6
danielb CreditAttribution: danielb commentedI'll look into that, cheers. Probably a few modules I need to update that on.
Comment #7
danielb CreditAttribution: danielb commentedcommitted, and will appear in future releases