Using block's "Page specific visibility settings-Show if the following PHP code returns TRUE" feature, I'm getting new errors after updating from 4.7. The original code was:
$n = node_load(arg(1));
if ($n->type == 'content_mag_author') { return TRUE; }
which now returns the following error(s):
warning: Invalid argument supplied for foreach() in /Library/WebServer/Documents/modules/node/node.module on line 504.
warning: implode() [function.implode]: Bad arguments. in /Library/WebServer/Documents/modules/node/node.module on line 508.
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.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 /Library/WebServer/Documents/includes/database.mysql.inc on line 167.
The offending code seems to be the node_load call. I've tried using $n=node_load($nid) with the same results.
Anyone have any leads?
Comments
simple fix
This works:
I really try to find the answers before I post, waiting until I've run out of options. Naturally I found the answer about 2 minutes after i posted the question. Still would be nice to hear if folks have a better approach for this...