Error in using php and 2 terms

eggthing - May 26, 2008 - 14:39
Project:Automatic Nodetitles
Version:5.x-1.1
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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

fago - June 8, 2008 - 12:21
Category:bug report» support request

#2

eggthing - June 13, 2008 - 22:52

Huh?

Was there meant to be an answer here?

#3

jonas28 - July 1, 2008 - 13:21

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

jonas28 - July 1, 2008 - 15:21

i found a solution here:

http://drupal.org/node/142286#comment-552293

i disabled the relativity module and everything is fine!

#5

fago - July 22, 2008 - 11:01
Status:active» fixed

#6

Anonymous (not verified) - August 5, 2008 - 11:02
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.