Closed (fixed)
Project:
Tagnode
Version:
4.6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
8 Oct 2005 at 04:02 UTC
Updated:
21 Jan 2006 at 07:58 UTC
I'm playing with the tagnode module on a test site. It seems to be working fine, but if I go to admin/settings/tagnode, I get the following errors at the top of the page:
user error: 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 'exists(select tid from term_data t where t.name = n.title)' at
query: select nid, title, type from node n where status=1 and type in ('flexinode-1') and not exists(select tid from term_data t where t.name = n.title) in /home/shavnyak/public_html/test/includes/database.mysql.inc on line 66.
user error: 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 'exists(select n.nid from node n where n.status=1 and n.title =
query: select t.tid, t.name, t.vid from term_data t where t.vid in (2) and not exists(select n.nid from node n where n.status=1 and n.title = t.name) in /home/shavnyak/public_html/test/includes/database.mysql.inc on line 66.My site is Drupal 4.6 on a Linux server, kernel 2.4.28, Apache 1.3.33, PHP 4.3.11, and MySQL 4.0.24
Comments
Comment #1
dado commentedShaven,
Yes, I was using SQL syntax that does not work w/ MySQL 4.0x
I fixed and committed to CVS. You can get the latest tagnode.module at
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/tagnode/
Please let me know thether this works.
Thanks,
Dado
Comment #2
dado commentedI received word from jasonwhat that this bug fix worked.
Comment #3
ShavenYak commentedLooks good to me now. Thanks!
Comment #4
samwilson commentedI am also getting this error, and I have tried both module files from CVS to no avail. I'm trying to figure it out now... I'll post what I come up with.
Comment #5
samwilson commentedOkay, I've figured something out:
In
_maintain_tagnodesand from line 855 there is the following:The problem I had was that I didn't have any tagnode types, so the WHERE clause was reading
WHERE n.status=1 and n.type in () and t.name is NULL, which clearly is invalid. My solution is to build that part of the WHERE clause that applies to tagnode_types beforehand, as show below.Also, a similar situation was occuring around line 900, which I solved with a similar patch:
Comment #6
dado commentedsamwilson,
Outstanding work! Many thanks. I will incorporate your fixes ASAP (next ~day). Also adding 1 or 2 other changes courtesy of gondalo.
dado
Comment #7
nethome commentedSame problem occurs in my setup (4.6) but the patch suggested here does not solve the problem. The error message that I get is following:
ON n.title = t.name where n.status=1 and n.type in () and t.name is NULL in /home/nethome/public_html/powerliving/includes/database.mysql.inc on line 66.
user error: 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 ') and n.title is NULL' at line 1
query: select t.tid, t.name, t.vid from term_data t LEFT JOIN node n ON t.name = n.title where t.vid in () and n.title is NULL in /home/nethome/public_html/powerliving/includes/database.mysql.inc on line 66.
Comment #8
dado commentedI changed samwilson 's fix slightly. I find no error currently. Committed to CVS, DRUPAL-4-6 branch. Please let me know if this fixes. Will commit these fixes to HEAD version also if all is well.
Thanks!
Dado
Comment #9
dkruglyak commentedi tried the latest fix from DRUPAL-4-6, running on PHP 5 / Linux. Here are the errors i get:
=== [Case 1] No node types are defined as tagnodes ===
A) Opening tagnode maintenance gives this error
B) Opening create content on any node type gives this error
=== [Case 2] Some node types are defined as tagnodes ===
A) Opening tagnode maintenance works fine
B) Opening create content on any node type gives this error
Comment #10
dkruglyak commented... and here is what shows up on front page, per previoius example:
Comment #11
dado commenteddkruglyak,
Thanks for the bug reports. I am unable to reproduce in my PHP4 environment. I wonder if this is an issue on PHP5 only. If you have any inspiration to investigate fixing please don't hesitate to contact me w/ questions/ideas (either posing here or contact me directly). I will pursue at my end by trying to figure out the bug & perhaps running attempted fixes by you. Many thanks,
dado
Comment #12
dado commentedOK, I committed changes to CVS (DRUPAL-4-6 branch). I hope & expect these to resolve some of the problems highlighted by dkruglyak. I believe these bugs are apparent when running tagnode on Drupal 4.6 and PHP 5.
Particularly, I believe the changes might fix the bugs which occur when no tagnodes have been defined.
I do not have a PHP 5 environment to test, so I would be grateful for any feedback as to whether current version (for Drupal 4.6) is working. Thanks,
Dado
Comment #13
dado commentedI got a PHP5 dev environment and was able to fix a number of bugs on PHP5. Now the module seems to work on PHP4 & PHP5 without any errors I am aware of.
Comment #14
dado commentedno reply. i assume the fixes worked.
Comment #15
dries commented