node preview broken in template.php

VERIFIED FIXED

Status

Websites Graveyard
spreadfirefox.com
VERIFIED FIXED
10 years ago
7 years ago

People

(Reporter: abuchanan, Assigned: abuchanan)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

10 years ago
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)

Comment 1

10 years ago
Created attachment 337110 [details] [diff] [review]
don't reload node, use $vars['node'], fix for node without NID
Assignee: nobody → buchanae
Attachment #337110 - Flags: review?(paul)

Updated

10 years ago
Attachment #337110 - Flags: review+

Comment 2

10 years ago
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
(Assignee)

Updated

10 years ago
Duplicate of this bug: 455296
(Assignee)

Comment 4

10 years ago
committed to trunkm in r18234
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Alix: would you be so kind as to verify this bug?  Thanks!

Updated

10 years ago
Status: RESOLVED → VERIFIED
(Assignee)

Updated

9 years ago
Attachment #337110 - Flags: review?(paul)
(Assignee)

Comment 6

9 years ago
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.