why dose these php errors come up

coldfly - August 4, 2007 - 13:36

I have often received the php errors like this, I don't know if it is a bug or setting error.

also I found that when you visit http://www.eefan.net/book/export/html/misc/print.css in the browser and then visit the frontpage http://www.eefan.net/ and these errors come up.

Location http://www.eefan.net/book/export/html/misc/print.css

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.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 /domains/eefan.net/public_html/includes/database.mysql.inc on line 172

Invalid argument supplied for foreach() in /domains/eefan.net/public_html/modules/node/node.module on line 521

implode() [<a href='function.implode'>function.implode</a>]: Bad arguments. in /domains/eefan.net/public_html/modules/node/node.module on line 525

Is there anyone who has the

coldfly - August 5, 2007 - 15:22

Is there anyone who has the same error with me?

just got a similaar message

nwe_44 - August 8, 2007 - 15:25

will let you know if I find anything in my bug checking.

here are the modules which i

coldfly - August 9, 2007 - 12:47

here are the modules which i use in the site, they are all official release, i hope it can help
auditfiles
blogger
buddylist
google_analytics
gsitemap
image
invite
og
panels
pathauto
poormanscron
privatemsg
tinymce
views

my server info Apache

coldfly - August 11, 2007 - 15:06

my server info
Apache 2.2.4
MySQL 5.0.41

The same error with me

LUTi - August 26, 2007 - 15:39

I've noticed the same error today.

In fact, there were 3 separate errors logged, which are related to a
/book/export/html/misc/print.css
display (as above, just different order):

1.
Invalid argument supplied for foreach() in /modules/node/node.module on line 521.

2.
implode() [function.implode]: Bad arguments. in /modules/node/node.module on line 525.

3.
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.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 /includes/database.mysql.inc on line 172.

(I've skipped the site / file location part...)

I am sure it is introduced with 5.2 version of Drupal, as I didn't notice such errors with 5.1 before.

I think I've found the reason

LUTi - August 26, 2007 - 16:09

I believe the problem is that some other (past) version improperly used /misc/print.css address as above. Now in 5.2, since there is nothing at this address, those errors came up (if someone / something uses the old URL; the new printer friendly page display of a book does not generate those errors, so I presume a css is fetched from some other - probably the right one - address).

I believe I've resolved the problem creating a 301 redirect from /book/export/html/misc/print.css to /misc/print.css (using a great Path Redirect module, which I find extremely useful to resolv the obsolete URLs problems).

I'm getting the same exact error...

SomebodySysop - November 19, 2007 - 20:29

I'm getting the same errors, only when I click on any forum (except OG created forums). No other place. I do not have the book module installed. I don't know what I should create a redirect from in order to use your resolution. The only content type that appears to be affected are forum topics. Any ideas what I should do?

Hi SombodySysop, I'm also

Mark Theunissen - December 11, 2007 - 11:42

Hi SombodySysop,

I'm also getting these errors on forums... did you solve the problem?

Regards,
capdog

No resolution at all!

SomebodySysop - December 11, 2007 - 18:24

Need help!

I just updated my site to 5.5 and the errors still occur. The only thing I know for sure is that the error does NOT occur with forums created by og_forum. Help!

Quick fix

zenoyu - December 12, 2007 - 08:15

Just a quick dirty fix:

Open the /modules/node/node.module, goto line# 521

//* Line#521, insert below four lines:
$cond = array();
if( $param==null || !is_array($param) ){
return null;
}
// */
foreach ($param as $key => $value) {
$cond[] = 'n.'. db_escape_string($key) ." = '%s'";
$arguments[] = $value;
}
$cond = implode(' AND ', $cond);

OG User Roles Issue

SomebodySysop - December 12, 2007 - 20:24

If you are using OG User Roles, I have resolved this issue here: http://drupal.org/node/194214

Thanks for the help!

Here are some notes I received from the Developer list:

>>* warning: Invalid argument supplied for foreach() in
>>> > /modules/node/node.module on line 521.

>> This is almost always a case of node_load being called without a node id.

Right, more precisely, the nid is coming from a db query which comes back empty handed thus the fetch will be FALSE and then node_load fails with this error.

Well I think it goes without saying that you have to find all the calls to node_load in your theme or custom modules and make sure they have a nid - or at least make sure that nid is tested before making a call to node load.

Thanks, yes I traced the

Mark Theunissen - December 13, 2007 - 07:17

Thanks, yes I traced the issue to OG User Roles.

Thanks I'll install the updated module.

Cheers
Mark

Module not yet updated, only patch available

SomebodySysop - December 13, 2007 - 17:24

OGR Release 2.6 (the latest) does not contain this modification. You'll have to apply the patch in the link I supplied above. These changes will be incorporated in the new version. Thanks!

I hate to hack core, but

scottrigby - February 18, 2008 - 20:33

I hate to hack core, but spent hours looking in the forums for an answer. This is the only fix that will help.
I'm getting these errors and no telling what's causing them?
Anyway, thanks - hope this can get resolved soon - but in the meantime this fix seems to be working.
(i'm using core 5.7 by the way).

Scott Rigby
http://basekamp.com
http://PlausibleArtworlds.org

As a patch

alakon - March 5, 2008 - 00:39

I'm not 100% that this solved my problem, but I think it might. Here it is as a patch. Use it at your own risk (really).

http://www.neopoet.net/node-164499-0.patch

The patch gives me this

newswatch - June 28, 2008 - 15:21

The patch gives me this error:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/north/public_html/modules/node/node.module on line 1925

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/north/public_html/modules/node/node.module on line 1925

calling variables that don't exist!

bflora - May 14, 2008 - 10:26

I get this problem all the time...and it's whenever I'm messing with CCK fields and templating. For instance, if you create a field for a CCK type and then story its value to a variable in your template. Then at some point later you delete that field from the CCK type but keep calling it in your template....FAIL. You get the errors seen here.

Subscribing, may be

Summit - July 12, 2008 - 18:05

Subscribing, may be duplicate of each other: www.drupal.org/node/142286. Greetings, Martijn

 
 

Drupal is a registered trademark of Dries Buytaert.