I just upgraded from Views 6.x-2.6 to 6.x-2.12, and one of my "page" views broke. The date argument is not being joined properly. The way it's supposed to work is the URL passes a date and it shows every node assigned to that date.

Here's the error I get:
user warning: Unknown column 'node_data_field_weekly_edition.field_weekly_edition_value' in 'where clause' query: SELECT DISTINCT node.nid AS nid, node.created AS node_created FROM node node WHERE ((node.status <> 0) AND (node.type in ('wesley_wire'))) AND ((DATE_FORMAT(STR_TO_DATE(node_data_field_weekly_edition.field_weekly_edition_value, '%Y-%m-%dT%T'), '%Y-%m-%d') <= '2010-11-19' AND DATE_FORMAT(STR_TO_DATE(node_data_field_weekly_edition.field_weekly_edition_value, '%Y-%m-%dT%T'), '%Y-%m-%d') >= '2010-11-19')) ORDER BY node_created DESC in .../sites/all/modules/views/includes/view.inc on line 775.

Here's the old query that works:

SELECT node.nid AS nid,
   node.created AS node_created
 FROM node node 
 LEFT JOIN content_field_weekly_edition node_data_field_weekly_edition ON node.vid = node_data_field_weekly_edition.vid
 WHERE ((node.status <> 0) AND (node.type in ('wesley_wire')))
    AND ((DATE_FORMAT(STR_TO_DATE(node_data_field_weekly_edition.field_weekly_edition_value, '%Y-%m-%dT%T'), '%Y-%m-%d') <= '2010-11-19' AND DATE_FORMAT(STR_TO_DATE(node_data_field_weekly_edition.field_weekly_edition_value, '%Y-%m-%dT%T'), '%Y-%m-%d') >= '2010-11-19'))
   ORDER BY node_created DESC

And the new query that doesn't work (missing LEFT JOIN):

SELECT node.nid AS nid,
   node.created AS node_created
 FROM node node 
 WHERE ((node.status <> 0) AND (node.type in ('wesley_wire')))
    AND ((DATE_FORMAT(STR_TO_DATE(node_data_field_weekly_edition.field_weekly_edition_value, '%Y-%m-%dT%T'), '%Y-%m-%d') <= '2010-11-19' AND DATE_FORMAT(STR_TO_DATE(node_data_field_weekly_edition.field_weekly_edition_value, '%Y-%m-%dT%T'), '%Y-%m-%d') >= '2010-11-19'))
   ORDER BY node_created DESC

Let me know if you need the export. Thanks.

Comments

cindyr’s picture

Sorry, just realized I also updated Date from 6.x-2.3 to 6.x-2.7, but I think it's still a problem with the way Views is neglecting the Left Join (not a Date issue), so I'm leaving it under Views. Feel free to move it to Date if I'm wrong.

merlinofchaos’s picture

Project: Views (for Drupal 7) » Date
Version: 6.x-2.12 » 6.x-2.x-dev

If it's a date field handler, then date field is what adds the join.

cindyr’s picture

Anyone, any ideas?

cindyr’s picture

Version: 6.x-2.x-dev » 6.x-2.7
cindyr’s picture

Am I missing something? Is this not a bug?

damienmckenna’s picture

Status: Active » Closed (won't fix)

Unfortunately the Drupal 6 version of the Date module is no longer supported. That said, we appreciate that you took time to work on this issue. Should this request still be relevant for Drupal 7 please feel free to reopen it. Thank you.