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 DESCAnd 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 DESCLet me know if you need the export. Thanks.
Comments
Comment #1
cindyr commentedSorry, 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.
Comment #2
merlinofchaos commentedIf it's a date field handler, then date field is what adds the join.
Comment #3
cindyr commentedAnyone, any ideas?
Comment #4
cindyr commentedComment #5
cindyr commentedAm I missing something? Is this not a bug?
Comment #6
damienmckennaUnfortunately 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.