When I enable both Help injection and Help injection help I get this on front page:
warning: mysqli_real_escape_string() expects parameter 2 to be string, object given in X:\home\www.example.com\www\includes\database.mysqli.inc on line 323
warning: mysqli_real_escape_string() expects parameter 2 to be string, object given in X:\home\www.example.com\www\includes\database.mysqli.inc on line 323
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | helpinject-6.x-1.0-alpha5-458796-1.patch | 824 bytes | brahms |
Comments
Comment #1
brahms commentedI have the same error messages. They come from line 654 in the file helpinject.module in function helpinject_help_link:
In my problem case
$elementis a string "node" and$form_idis the node object. In this case I would expect thatisset($element['#type'])will return FALSE because$elementis not an array and therefore the array key '#type' doesn't exist. I don't know why, but PHP returns TRUE forisset($element['#type'])instead (and "n" for$element['#type']) and so the IF condition is evaluated to TRUE and in the next line the function helpinject_get_from_key is called with the node object as parameter$form_idwhich leads to the error message later. It really seems to be an error in the isset function in PHP, I use PHP 5.1.6 under Red Hat Enterprise Linux 5.To prevent these errors I added
is_array($element)to the IF clause, the modified line 654 in the file helpinject.module is now:I attach a patch file for fixing the error
Comment #2
robertdouglass commentedNice analysis brahms. Is the patch still coming?
Comment #3
brahms commentedSorry Robert, here is the patch file.
Comment #4
robertdouglass commentedCommitted, thanks.