Actual error message:
Unknown column node_data_field_published_date.field_published_date_value in where clause query: SELECT node.nid AS nid, node.type AS node_type, node.vid AS node_vid, node.title AS node_title FROM node node LEFT JOIN term_node term_node ON node.vid = term_node.vid LEFT JOIN term_data term_data ON term_node.tid = term_data.tid LEFT JOIN content_field_imprint node_data_field_imprint ON node.vid = node_data_field_imprint.vid WHERE ((node.type in (book)) AND (node.status <> 0) AND ((term_data.name) != (Reviews)) AND ((term_data.name) != (Awards)) AND (node_data_field_imprint.field_imprint_value = boyds mills)) AND (node_data_field_published_date.field_published_date_value BETWEEN 2010-01-01 AND 2010-05-31) ORDER BY node_title ASC LIMIT 0, 9 in /var/www/multisites/hfc/webroot/sites/all/modules/views/includes/view.inc on line 771.
I do have a custom module which alters the view where clause but I can't imagine it would cause this error:
/**
* Implementation of hook_views_query_alter
*/
function season_view_views_query_alter(&$view, &$query) {
if($view->name == 'releases') {
if(arg(3) == 'spring')
$query->where['date']['clauses'][0] = "node_data_field_published_date.field_published_date_value BETWEEN '". $view->args[1] ."-01-01' AND '". $view->args[1] ."-05-31'";
if(arg(3) == 'fall')
$query->where['date']['clauses'][0] = "node_data_field_published_date.field_published_date_value BETWEEN '". $view->args[1] ."-06-01' AND '". $view->args[1] ."-12-31'";
if(arg(3) != 'spring' && arg(3) != 'fall')
$query->where['date']['clauses'][0] = "node_data_field_published_date.field_published_date_value BETWEEN '". $view->args[1] ."-01-01' AND '". $view->args[1] ."-12-31'";
}
}
Platform:
Fedora release 12 (Constantine)
Linux 2.6.35.4-rscloud
Apache 2.2.15
MySQL 5.1.47-log
PHP 5.3.3
Drupal 6.20 multi-site environment shared with 3 other sites
Reverting back to date-6.x-2.6 fixes the problem.
Let me know if you need more information. Thanks!
Comments
Comment #1
crimsondryad commentedsubscribing
Comment #2
Apfel007 commentedsub
Comment #3
tomwrobel commentedsubscribing
Comment #4
tascsame here... subscribing
arg: 1991 or any other numeric value under 2008
views-sql:
SELECT node.nid AS nid, node.title AS node_title FROM d6_node node WHERE (node.type in ('semester')) AND (0=1)of course no errors ;)
arg: 2008
views-sql:
SELECT node.nid AS nid, node.title AS node_title FROM d6_node node WHERE (node.type in ('semester')) AND ((DATE_FORMAT(STR_TO_DATE(node_data_field_semester_sortable_date.field_semester_sortable_date_value, '%Y-%m-%dT%T'), '%Y') <= '2008' AND DATE_FORMAT(STR_TO_DATE(node_data_field_semester_sortable_date.field_semester_sortable_date_value, '%Y-%m-%dT%T'), '%Y') >= '2008'))error:
Views 6.x-2.12
Drupal 6.20
Date 6.x-2.7
strange so far,
I first thought its a Views-Bug, but after reverting Date-Module back to 2.6
my CCK- Date-Fields are still available as Fields, but as Arguments they have gone...
Comment #5
schnorte commentedsame for me: version 2.7 of the date module produced an error when incuding a date-field as argument in a view --> field-table will not be included in the view which triggers the sql-error.
workaround: when displaying nodes in a view as "fields", then the date-field can be included as field explicitly, but excluded from being rendered.
but I needed the view rendering full nodes, so I had to re-install date-module version 2.6
Comment #6
friedman commentedSame problem in calendar (date_browser), reverted date and calendar modules
Comment #7
hanno commentedsubscribe, date browser
Comment #8
spike22 commentedsame thing...but can't downgrade to 2.6 because of calendar module :S
Need patch! :(
Comment #9
hanno commentedhttp://drupal.org/node/580178#comment-3917652 worked for me.
Comment #10
drm commentedI just upgrade from 2.6 to 2.7 (Views 2.12 to 2.14 as well) and got this error. Fixed it by adding the date argument to the field list (display excluded). Apparently the new version of (date | views) does not add the join to the query without this. Other arguments in my view (text fields, not date) are not in the field list and are still working.
Comment #11
damienmckennaUnfortunately the D6 version of this module is no longer supported, but we appreciate the time you put into this. If this problem is relevant for D7 too, please reopen the issue. Thanks.