I get the Warning for every time i display a view. So for example i have Dashboard module enabled on homepage displaying 5 different views in it, when i load the page i get 5 warnings of the kind:

    * user warning: Unknown table 'n' in where clause query: SELECT count(*) FROM node node LEFT JOIN term_node term_node ON node.nid = term_node.nid LEFT JOIN term_data term_data ON term_node.tid = term_data.tid LEFT JOIN node_counter node_counter ON node.nid = node_counter.nid WHERE ((n.type <> 'content-event')) AND (term_node.tid IN ('57','58','59')) AND (node.status = '1') AND (node.promote = '1') in /home/mysite/public_html/drupal/includes/database.mysql.inc on line 120.

    * user warning: Unknown table 'n' in where clause query: SELECT node.nid FROM node node LEFT JOIN term_node term_node ON node.nid = term_node.nid LEFT JOIN term_data term_data ON term_node.tid = term_data.tid LEFT JOIN node_counter node_counter ON node.nid = node_counter.nid WHERE ((n.type <> 'content-event')) AND (term_node.tid IN ('57','58','59')) AND (node.status = '1') AND (node.promote = '1') ORDER BY term_data.weight DESC, term_data.name DESC, node.changed DESC, node_counter.totalcount DESC LIMIT 0, 10 in /home/mysite/public_html/drupal/includes/database.mysql.inc on line 120.


Just updated to last cvs Views of today (13th july), Drupal 4.7.2.
Other relevant modules enabled: Category, CCK

Any help apreciated!

cheers

CommentFileSizeAuthor
#6 screenshot_unknown_table_n.pdf69.19 KBmarcoBauli

Comments

marcoBauli’s picture

Title: Unknown table 'n' » Warning: Unknown table 'n'
marcoBauli’s picture

ok, tryed disabling all contrib modules except Views and the warnings are still there.

When disabling Views they disappear and get replaced by the following other warning:

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 'IN ('content-spot')) AND (.tid IN ('90','91','92','93','94','95','96','97','98'' at line 1 query: SELECT node.nid FROM node node WHERE (.type IN ('content-spot')) AND (.tid IN ('90','91','92','93','94','95','96','97','98','99','100','101','102','103','104','105','106','107','108','109','110',
'111','112','113','114','115','116','117','118','119','120','121','122','123','124','125','126',' in 
/home/kiteatla/public_html/drupal/includes/database.mysql.inc on line 120.

warnings appear almost on every page.

marcoBauli’s picture

now disabled ALL modules (except the required ones of course), but cannot get rid of the above warning #2 on /admin/modules page...weird..

should this problem be addressed to Drupal core at this point?

PS: my node types where created with an early version of CCK and then updated, but now CCK, Category, everything is disabled...i'm really lost now

moshe weitzman’s picture

all modules are active on the admin/modules page. to get rid of errors there, you have to rename your .module files.

moshe weitzman’s picture

all modules are active on the admin/modules page. to get rid of errors there, you have to rename your .module files.

marcoBauli’s picture

Priority: Normal » Critical
StatusFileSize
new69.19 KB

ok, about #2 above, i had to completely cancel a "bad" view to eliminate the warning (it was showing even if Views module was disabled..eek!)

Now:
re-enabling Views i get back to the initial Warning above, and actually i get a different 'Unknown table 'n'' for each of my views (see screenshot attached).

Notes:

  • i am on Drupal 4.7.2, latest cvs Views 1.141, latest CCK 1.64
  • i tryed disabling role_weights.module (just in case!) but nothing changed.
  • the warnings appear for both 'page' and 'block' views and both 'teaser list' and 'list' views.
  • the warnings appear only for registered and anonymous users, but not for user number 1 (superadmin): no errors thrown here, and the view display correctly.

setting this to critical since it's throwing loads of errors and the views are not displayed at all.

merlinofchaos’s picture

Try going to each of your views and resaving them. The query is often cached on the view, and some of the earlier Views updates can break with that caching unfortunately.

marcoBauli’s picture

yes, caching can be a pain when testing (test-cleanbrowsercache-cleandrupalcache-retest-....): where is the "caching switch-off" button?! ;)

Anyway i found:
the cause of the problem is the CCK Full-CRUD patch of content.module.
Overwriting it with the regular cvs file all the Warnings disappear and the views got back to life!
(well, almost all, one is still giving problems but maybe that's for another issue)

i'd love to be php-savvy but i'm noob so don't have the possibility to reroll the patch, sorry about that ;-|

marcoBauli’s picture

Priority: Critical » Normal
marcoBauli’s picture

Status: Active » Closed (fixed)

closing this as is not a Views problem. Posted also a follow up about this problem on the CCK patch i was talking about (see link at #8 above).