After upgrading from 5.x-1.5 I get the following error message on some output pages:

user warning: Unknown column 'content_type_forum.field_posts_value' in 'where clause' query: SELECT count(node.nid) FROM drupal_node node LEFT JOIN drupal_content_type_forum node_data_field_posts ON node.vid = node_data_field_posts.vid WHERE (node.status = '1') AND (node.type IN ('forum')) AND (content_type_forum.field_posts_value > '0') in /srv/www/vhosts/myproject.de/httpdocs/includes/database.mysqli.inc on line 151.

The field content_type_forum.field_posts_value should be drupal_content_type_forum.field_posts_value. So it looks like the database table prefix is missing.

This error occurs only with view type Table View.

Ciao Alex...

Comments

merlinofchaos’s picture

Title: Missing database table prefix » CCK table getting wrong alias?

Your assessment is incorrect. The table 'content_type_forum' is properly getting the index, but instead of being aliased to 'content_type_forum' it's being aliased to 'node_data_field_posts'.

This may be a cascade effect from another bug I fixed. This may or may not be a CCK issue; I'm not certain and I know yched reads these issues so I'm going to leave it here for the moment.

merlinofchaos’s picture

Ok, I believe this was caused by http://drupal.org/node/130196 -- I've reverted that patch for beta3.

merlinofchaos’s picture

Status: Active » Fixed
yched’s picture

The 'node_data_*' alias is the normal one for cck field tables.
The actual tables have indeed moved to the 'content_*' namespace to avoid conflict with core tables (that was CCK 1.2 or 1.3), but I was not sure of the consequences of renaming the views _aliases_, so i left them as they were, would certainly can be confusing (but at least makes it clear that we're dealing with aliases :-) )

Anonymous’s picture

Status: Fixed » Closed (fixed)