We are using Drupal on the following platform:
Drupal 4.7.4
mySql 5.0.27
PHP 5.2.0
The following additional modules have been added, but we don't think they're have any thing to do with receiving the below error.
adsense
invite
privateMsg
Below is the error message we receive anytime we click the PREVIEW POST button:
warning: Invalid argument supplied for foreach() in C:\Inetpub\wwwroot\boogleblog\modules\node.module on
line 359.
warning: implode() [function.implode]: Bad arguments. in C:\Inetpub\wwwroot\boogleblog\modules\node.module on
line 363.
user warning: You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment,
n.promote, n.moderate, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body,
r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u
ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE
in C:\Inetpub\wwwroot\boogleblog\includes\database.mysqli.inc on line 122.
Could you please let us know how to fix this?
We have commented the following code referenced in the above error so that the error does not display when users click the Preview Post button:
LINE 357 OF NODE.MODULE:
///// else {
// Turn the conditions into a query.
///// foreach ($param as $key => $value) {
///// $cond[] = 'n.'. db_escape_string($key) ." = '%s'";
///// $arguments[] = $value;
///// }
///// $cond = implode('AND', $cond);
///// }
LINE 122 OF DATABASE.MYSQLI.INC:
}
else {
/// trigger_error(check_plain(mysqli_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
return FALSE;
}
}
Could you please let us know how to modify the above commented lines in Node.Module to eliminate the error. We're not certain if leaving those lines commented is going to be critical to the function of Drupal, but so far, leaving them commented does not seem to have a negative effect.
Please help.
Thank you.
Comments
Comment #1
ChrisKennedy commentedAssigning a more descriptive title - thanks for the bug report.
You're getting an error because $param is some type besides numeric or array - probably a string. This is most likely an error in one of the installed contrib modules. Have you tried disabling all contributed modules and seeing if you still get the error?
Comment #2
ricabrantes commented@luger: any news??
Comment #3
pasqualleThis version is not supported. Reopen or create a new issue if the problem exists in any recent version (version equal or above Drupal 5)