Closed Bug 453864 Opened 16 years ago Closed 16 years ago

node preview broken in template.php

Categories

(Websites Graveyard :: spreadfirefox.com, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: abuchanan, Assigned: abuchanan)

References

Details

Attachments

(1 file)

bug 453835 uncovered an error in template.php _phptemplate_variables()

the following errors are printed when previewing a new node you are creating...

   * warning: Invalid argument supplied for foreach() in
/data/www/spreadfirefox.authstage.mozilla.com/modules/node/node.module on line
521.
    * warning: implode() [function.implode]: Bad arguments. in
/data/www/spreadfirefox.authstage.mozilla.com/modules/node/node.module on line
525.
    * 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
/data/www/spreadfirefox.authstage.mozilla.com/includes/database.mysql.inc on
line 172.
    * warning: Invalid argument supplied for foreach() in
/data/www/spreadfirefox.authstage.mozilla.com/modules/node/node.module on line
521.
    * warning: implode() [function.implode]: Bad arguments. in
/data/www/spreadfirefox.authstage.mozilla.com/modules/node/node.module on line
525.
    * 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
/data/www/spreadfirefox.authstage.mozilla.com/includes/database.mysql.inc on
line 172.

these are thrown because of faulty logic in template.php on line 171.

     $node = node_load($vars['node']->nid);

when previewing a node, no node ID exists yet, so a node can't be loaded by nid
Assignee: nobody → buchanae
Attachment #337110 - Flags: review?(paul)
Attachment #337110 - Flags: review+
Comment on attachment 337110 [details] [diff] [review]
don't reload node, use $vars['node'], fix for node without NID

changes work  fine on my local server
committed to trunkm in r18234
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Alix: would you be so kind as to verify this bug?  Thanks!
Status: RESOLVED → VERIFIED
Attachment #337110 - Flags: review?(paul)
Comment on attachment 337110 [details] [diff] [review]
don't reload node, use $vars['node'], fix for node without NID

cleaning out the request queue, this review is no longer needed, bug is resolved fixed
Product: Websites → Websites Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: