Active
Project:
Node Template
Version:
6.x-1.0
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Feb 2010 at 14:21 UTC
Updated:
29 Jan 2011 at 17:23 UTC
Jump to comment: Most recent file
I got the error below while installing
Parse error: syntax error, unexpected T_STRING in sites/all/modules/node_template/nodetemplate.module on line 212
$existed_node = db_result(db_query("SELECT COUNT(*) FROM {node_template} WHERE nid = %d', $nid));
I don't know how to create patches so i'll just post the fix. Single quote used to close Double quote. Just replace single quote with double quote at the end of the query string.
$existed_node = db_result(db_query("SELECT COUNT(*) FROM {node_template} WHERE nid = %d", $nid));
;)
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | nodetemplate.module.patch | 672 bytes | foxfabi |
Comments
Comment #1
muximus commentedSorry same error on the following lines
Line: 257
change
$existed_node = db_result(db_query("SELECT COUNT(*) FROM {node_template} WHERE nid = %d', $nid));
to
$existed_node = db_result(db_query("SELECT COUNT(*) FROM {node_template} WHERE nid = %d", $nid));
Line: 114
change
$existed_node = db_result(db_query("SELECT COUNT(*) FROM {node_template} WHERE nid = %d', $nid));
to
$existed_node = db_result(db_query("SELECT COUNT(*) FROM {node_template} WHERE nid = %d", $nid));
Line: 281
change
db_query("INSERT INTO {node_template} (nid, is_template, shared) VALUES (%d, %d, %d)', $nid, 1, 0);
to
db_query("INSERT INTO {node_template} (nid, is_template, shared) VALUES (%d, %d, %d)", $nid, 1, 0);
Comment #2
paskainos commentedFYI: I received a similar error:
I made the same changes:
to:
on lines 208, 253, and 277 (in nodetemplate.module) which seems to have fixed it in my case.
Comment #3
edan7 commentedFYI -
Encountered this issue with 6.1 but seems to be resolved for me (so far) with dev version 6.x-1.x-dev.
Comment #4
majorbenks commentedI got the same error: Parse error: syntax error, unexpected T_STRING in sites/all/modules/node_template/nodetemplate.module on line 212
But in my file the %d' is a %d" but it is still not working
Here is that line of code where the error comes:
db_query("INSERT INTO {node_template} (nid, is_template, shared) VALUES (%d, %d, %d)", $nid, 1, 0);And this line is in this environment:
Comment #5
foxfabi commentedi have changed the " with ' on lines: 208, 253, 277