error in sql syntax

rajaiskandarshah - July 16, 2008 - 12:51
Project:Taxonomy Autotagger
Version:5.x-1.9
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

received the following error when running cron.php

Type php
Date Wednesday, 16 July, 2008 - 20:45
User Abdul Rahim
Location http://panduan.org/cron.php
Referrer
Message 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 t.tid, t.vid FROM term_data t LEFT JOIN term_synonym s ON s.tid = t.tid WHERE(LOWER(t.name) IN ('seremban','seorang','pemain','bola','sepak','negeri','sembilan','cedera','ringan','apabila','kereta','yang','dinaikinya','terbabas','di','kilometer','227','6','lebuh','raya','air','keroh','dekat','sini','semalam') OR LOWER(s.name) IN ('seremban','seorang','pemain','bola','sepak','negeri','sembilan','cedera','ringan','apabila','kereta','yang','dinaikinya','terbabas','di','kilometer','227','6','lebuh','raya','air','keroh','dekat','sini','semalam')) AND vid IN () in /home/panduan/public_html/includes/database.mysql.inc on line 172.
Severity error
Hostname 202.75.42.21

there are few instances of the same type of error

#1

rajaiskandarshah - July 16, 2008 - 13:10

added and enabled cck content module

but still the same error when creating a new page content.

#2

sdrycroft - July 16, 2008 - 18:16

I can see why the error is occurring. You have no vocabularies of type "multiple" that are marked as being associated with the content type of the node that is being searched. I'll sort a fix for this tomorrow.

#3

rajaiskandarshah - July 16, 2008 - 23:17

noted. all my vocabularies are multiple. and i have now marked for all content types. but i still get the same error message.

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 t.tid, t.vid FROM term_data t LEFT JOIN term_synonym s ON s.tid = t.tid WHERE(LOWER(t.name) IN ('berita','malaysia','dan','indonesia') OR LOWER(s.name) IN ('berita','malaysia','dan','indonesia')) AND vid IN () in /home/panduan/public_html/includes/database.mysql.inc on line 172.

modules that i have are listed on:
http://panduan.org/Utama

thanks for the quick reply. by the way, this is a great module - i have been looking for something similar for the past 1 year.

#4

fluxline - July 17, 2008 - 08:03

the error that gets kicked off in the log is:

Message Invalid argument supplied for foreach() in path/modules/autotag/autotag.module on line 363.

#5

sdrycroft - July 17, 2008 - 12:56

Raja, can you try the 1.9 release and see if that fixes your problem.

#6

fluxline - July 17, 2008 - 21:44

i given 1.9 a go but still getting 9 of these errors:

Invalid argument supplied for foreach() in /path/modules/autotag/autotag.module on line 363. thrown when you save changes to the settings page.

must be one for each of the nodes that is being checked. and no terms are getting attached. can you confirm that in the settings area for content types to be evaluated; if the box has a check then the field is queried and tagged; if it does not have a check then it is ignored. i ask because the description above says 'fields to ignore' but the description below says uncheck. i was getting tags in a test install but with 'production' site with more modules i get nothing except some fields i thought were set to ignore. the ones i tried to query came back with nothing.

#7

rajaiskandarshah - July 18, 2008 - 02:21
Version:5.x-1.8» 5.x-1.9

updated to 1.9 release.

when i create a page type of content, tags were not added (eventhough i had written the content using terms that i had created in vocabularies). looking at the recent log entries - there were some errors :
error php 18/07/2008 - 09:21 Invalid argument supplied for foreach() in ... Abdul Rahim
error php 18/07/2008 - 09:21 Invalid argument supplied for foreach() in ... Abdul Rahim
error php 18/07/2008 - 09:21 Invalid argument supplied for foreach() in ... Abdul Rahim
error php 18/07/2008 - 09:21 in_array() [

#8

rajaiskandarshah - July 18, 2008 - 02:42

some more quick notes.

on the autotag settings, i have checked for title of page. then created a page.

the page is saved but no tags.

in the recent log entries before saving of the page, there were a number of errors some of them relating to polls, images and forum (which i do not use on my site) - do i need to have the checkboxes in autotag settings checked (with a tick) or unchecked (with no tick) ?

examples of errors received:

in_array() [function.in-array]: Wrong datatype for second argument in /home/panduan/public_html/modules/autotag/autotag.module on line 372.

Invalid argument supplied for foreach() in /home/panduan/public_html/modules/autotag/autotag.module on line 363.

Missing argument 1 for poll_form() in /home/panduan/public_html/modules/poll/poll.module on line 118.

thanks for your patience. this is a great module, soon as you can fix the bugs, i think this will be very popular. i am already thinking of defining geo location tags. this would be very interesting to track events like earthquakes that are happening around the world as reported in the news.

i am not in favor of using yahoo term extraction, coz the tags returned are worthless for non-english terms. or for sites that are focused on certain topics which need to have its own terms (think chemistry)

#9

rajaiskandarshah - July 18, 2008 - 03:25

narrowed down the errors.

the errors only happen when saving the autotag settings.

#10

sdrycroft - July 18, 2008 - 09:10

When editing a node, do you see a "Submit" button, or a "Next" button? If you're seeing a "Submit" button, then your taxonomy is not set up correctly. You need to do the following:

  • Create a vocabulary, or use one that you already have created
  • Select:
    • The content types you'd like to have autotagged
    • Multiple Select
  • Do NOT select:
    • Free tagging
    • Required
  • Ensure that there are terms in this vocabulary
  • Edit/create a node of a type that you selected for the vocabulary above
  • If there is no submit button, but there is a next button, then Autotag will hopefully work on this node
  • Enter information into the node, including a word that is present in your vocabulary, and press next
  • Report your results here

You do not need to change any settings on the autotag settings page, in fact, by blindly ticking the boxes you're actually restricting how autotag works, and not enabling it to work better.

#11

fluxline - July 18, 2008 - 09:56

you are correct, when a node has submit instead of a next then it does not work on that content type. why is this? thanks for that troubleshooting tip.

so i followed the advice above:
-recreated a content type

-created a new vocab with the settings above and selected new content type as associated type
-populated vocab with new terms that will be in new content

- created some content with terms in vocab

-autotag settings, only selected the new content type to autotag (yes, i know what you said above. just testing)
- saved settings

-ran cron

Results:
-as advertised, content was tagged with terms from new vocab
-additional bonus tags from old vocab terms that were not selected as associated with the new content type
-error in log: Invalid argument supplied for foreach() in path/modules/autotag/autotag.module on line 363.

maybe you could explain a bit about the not changing the settings and how it improves things. i would think i would be able to restrict the content types i would want to autotag. spent some time going through your code (excellent commenting thanks!) but not coming from the php world, i'm a bit illiterate at the moment.

once i understand how this works, i will set up some documentation if it will help.

#12

rajaiskandarshah - July 20, 2008 - 12:47

edited the vocabularies so that it is NOT freetagging.

created new content page comprising of words contained in the vocabulary. the button next is displayed at the bottom of the page. clicking on next, displays a screen of tags identified for the content (correctly) and the option to add any other tag. clicking on the submit button posts the content.

however, i get these errors on the page after posting the content:
* user warning: Duplicate entry '18-102048' for key 1 query: INSERT INTO term_node (nid, tid) VALUES (102048, 18) in /home/panduan/public_html/includes/database.mysql.inc on line 172.
* user warning: Duplicate entry '71-102048' for key 1 query: INSERT INTO term_node (nid, tid) VALUES (102048, 71) in /home/panduan/public_html/includes/database.mysql.inc on line 172.

no other errors noted on the recent log entries.

this is really great, especially for non-english language sites.

#13

rajaiskandarshah - July 21, 2008 - 04:34

over the weekend, i noted that my previous content were not being autotagged.

did a little experimenting, and found out that in autotag setting, the checkbox for the content type needs to have a check (tick) for it to be autotagged.

also noted that if the node has already been tagged, then autotag will will display an error message:

warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/panduan/public_html/modules/autotag/autotag.module on line 150.

and after clicking on the submit button, then the additional tags are added but another error message is displayed:

* warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/panduan/public_html/modules/autotag/autotag.module on line 150.
* user warning: Duplicate entry '71-102282' for key 1 query: INSERT INTO term_node (nid, tid) VALUES (102282, 71) in /home/panduan/public_html/includes/database.mysql.inc on line 172.

#14

sdrycroft - December 15, 2008 - 17:31
Status:active» won't fix

Apologies, but I'm marking this as "won't fix". We're currently pushing all our modules up to D6, and won't be fixing any D5 bugs (unless major). D5 is no longer a supported release.

#15

kenorb - January 20, 2009 - 15:24

#16

brianbrown - April 27, 2009 - 04:40

Crappy module!

 
 

Drupal is a registered trademark of Dries Buytaert.