After installing mypage 4.5.0 in drupal 4.5.1, this error occurs and appears at the top of the page when viewing the page.

Location
/?q=mypage/view

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.status = 1 AND '1'' at line 1 query: SELECT COUNT(DISTINCT(n.nid)) FROM node n INNER JOIN term_node tn ON n.nid = tn.nid WHERE tn.tid IN () AND n.status = 1 AND '1' in /opt/lampp/htdocs/includes/database.mysql.inc on line 125.

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.status = 1 AND '1' ORDER BY n.sticky DESC, n.created DESC LIMIT 0, 10' at line 1 query: SELECT DISTINCT(n.nid), n.sticky, n.created FROM node n INNER JOIN term_node tn ON n.nid = tn.nid WHERE tn.tid IN () AND n.status = 1 AND '1' ORDER BY n.sticky DESC, n.created DESC LIMIT 0, 10 in /opt/lampp/htdocs/includes/database.mysql.inc on line 125.

CommentFileSizeAuthor
#5 mypage.module9.56 KBandynyc

Comments

vmarks’s picture

forgot to mention, it's running on the apachefriends.org/en distribution of apache/php4.3.9/mysql

tulula’s picture

I just wanted to add that I'm also experiencing this same error after having added the module just now.
I upgraded to 4.5.1 when it first came out and only got around to adding this module today.

Lisa

tulula’s picture

Error is gone - KEY is going under "MY ACCOUNT -- BUILD MY PAGE" and then adding which taxonomy items one wishes to view on his/her page. Stepping back to VIEW MY PAGE then outputs in a custom way your choice view!

Lisa

andynyc’s picture

Thanks Lisa for confirming what I thought... based on the SQL error, it seemed that the problem was that there were no selected taxonomies. Once you select some, as Lisa did, in "Build My Page", it should work OK.

That being said, I will work on a patch, having an error like this is obviously a problem.

Happy Holidays!

andynyc’s picture

Assigned: Unassigned » andynyc
StatusFileSize
new9.56 KB

I believe this patch will fix the problem. The error was caused when a user had selected zero taxonomies to add to his/her "mypage". Of course, this means that new users and new installations of the modules would return the error.

The fix checks if the user has not selected any taxonomies, and if so, just shows a general view of all nodes (i.e. the front page of the site)

Just replace the mypage.module with the new attached file.

jaskegreen’s picture

Still not working. Gives an unexpected T-String error on line 44. I looked at it and it looks the same as the previous version. Any ideas?

Jason

andynyc’s picture

Priority: Critical » Normal

The SQL error has been fixed with the patch in comment #5.

I have asked "jaskegreen" to submit a new bug report since he is describing a completely different bug.

Anonymous’s picture