Error in using php and 2 terms
| Project: | Automatic Nodetitles |
| Version: | 5.x-1.1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
I'm using 2 categories and trying to use token to fill automatic nodetitle with the top terms from each category using this code:
<?php
global $form_values;
return $form_values['taxonomy']['tags'][18]." "$form_values['taxonomy']['tags'][23];
?>It seems to work in creating the concatenated title with the 2 terms, but not without giving me this error.
* warning: Invalid argument supplied for foreach() in /home/mysite/public_html/modules/node/node.module on line 521.
* warning: implode() [function.implode]: Invalid arguments passed in /home/mysite/public_html/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 /home/mysite/public_html/includes/database.mysql.inc on line 172.
I get the error whether I try to us just one term or both concatenated. so it seems more likely due to there being 2 categories. In fact I even got the error without using php but by using a replacment from the token module.
But the title does create ok an dit seems to work fine. So can I just shut off the error message?

#1
#2
Huh?
Was there meant to be an answer here?
#3
i have a similar problem and i get the same error message when I try to get the title from a nodereferencefield with the token following [field_hvv_semester-title]:
* warning: Invalid argument supplied for foreach() in /srv/www/htdocs/mms/epb/modules/node/node.module on line 521.
* warning: implode() [function.implode]: Invalid arguments passed in /srv/www/htdocs/mms/epb/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 epb_node n INNER JOIN epb_users u ON u.uid = n.uid INNER JOIN epb_node_revisions r ON r.vid = n.vid WHERE in /srv/www/htdocs/mms/epb/includes/database.mysql.inc on line 172.
greetings from hamburg
Jonas
#4
i found a solution here:
http://drupal.org/node/142286#comment-552293
i disabled the relativity module and everything is fine!
#5
#6
Automatically closed -- issue fixed for two weeks with no activity.