Hello,
I am having this little problem with My Movies' Module.
As an anonymous user, when I go to "My Movies", I get an error message and I can't see any of the movies I entered in the database. As soon as I log on (as the admin), the error message disappears.
These error messages are:
--------------
Error messages:
for "My Movies":
user warning: Unknown table 'n' in on clause query: SELECT COUNT(*) FROM db_movies INNER JOIN db_node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) in /usr/local/pem/vhosts/webspace/httpdocs/drupal5/includes/database.mysql.inc on line 172.
and
user warning: Unknown table 'n' in on clause query: SELECT * FROM db_movies INNER JOIN db_node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) ORDER BY movie_name ASC LIMIT 0, 50 in /usr/local/pem/vhosts/webspace/httpdocs/drupal5/includes/database.mysql.inc on line 172.
for "My Movies Wishlist":
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 'INNER JOIN db_node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((n' at line 1 query: SELECT COUNT(*) FROM db_movies_wishlist where added_to_movies=0 INNER JOIN db_node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) in /usr/local/pem/vhosts/webspace/httpdocs/drupal5/includes/database.mysql.inc on line 172.
and
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 'INNER JOIN db_node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((n' at line 1 query: SELECT * FROM db_movies_wishlist where added_to_movies=0 INNER JOIN db_node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) ORDER BY movie_name ASC LIMIT 0, 50 in /usr/local/pem/vhosts/webspace/httpdocs/drupal5/includes/database.mysql.inc on line 172.
--------------
I checked the tables with myphpadmin and it all seems good. I even talked with the customer care of my hosting company and they say the database is alright. They think it might be a problem with the script (module..).
"Movies" is the only module enabled at the moment.
Any help would be appreciated
Thank you,
itsanogo
Comments
Comment #1
IanBezanson commentedI will take a look into this and see if I can figure it out.
Comment #2
IanBezanson commentedWhat version of Drupal are you running?
Comment #3
IanBezanson commentedThis should be fixed now. I found an issue when paginating, and I was not supplying the movie/wishlist table names, as well as the primary db keys. When these aren't present, the function seems to _sometimes_ supply default values, which mess everything up.
I've released 5.x-1.2 if you'd like to try that out and let me know if it solves your issue.
Cheers!
Comment #4
itsa commentedSorry about the delay, just got back from the field.
I am running Drupal 5.2.
I installed the latest module 1.2 and I don't get the error anymore. (Thanks!)
I just opened a new ticket (http://drupal.org/node/181127) for database error messages when creating a new account in Drupal or editing my user profile. Those errors only happen after installing your module.
Thank you for your help,
itsanogo