Closed (fixed)
Project:
Calendar
Version:
6.x-2.0-rc5
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Nov 2008 at 20:27 UTC
Updated:
17 Dec 2008 at 00:42 UTC
Don't know if it depends on a date module bug, but after upgrading to rc5, calendar does not display correctly content types with a from-to cck date field.
This is the views query:
SELECT node.nid AS nid,
node_data_field_event.field_event_value AS node_data_field_event_field_event_value,
node_data_field_event.field_event_value2 AS node_data_field_event_field_event_value2,
node.title AS node_title,
node_data_field_event.nid AS node_data_field_event_nid,
node.type AS node_type,
node_revisions.body AS node_revisions_body,
node_revisions.format AS node_revisions_format
FROM node node
LEFT JOIN content_type_event_polo node_data_field_event ON node.vid = node_data_field_event.vid
LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
WHERE ((TO_CHAR(TO_DATE(node_data_field_event.field_event_value, 'FMYYYY-FMMM-FMDDTFMHH:FMMI:FMSS'), 'YY-MM') <= '2008-11' AND TO_CHAR(TO_DATE(node_data_field_event.field_event_value2, 'FMYYYY-FMMM-FMDDTFMHH:FMMI:FMSS'), 'YY-MM') >= '2008-11'))
As you can see, the date evaluation is wrong because of the 'YY-MM' can't be correctly evaluated against the "2008-11" date format.
Comments
Comment #1
samuelet commentedAtm, the only working workaround i have found is to replace the 'YY-MM' occurrence into 'YYYY-MM' inside the sql_format() function (in the date_api_sql.inc file of date module), as explained also here:
http://drupal.org/node/312103#comment-1066262
I fear that it' s not the right solution.
Comment #2
dond commentedI think I have the same problem with a view filtering on 'less than now' which used to work but stopped a couple of updates ago. The filter works with 'greater than'. This has cropped up in more than one issue eg http://drupal.org/node/337764 and perhaps also http://drupal.org/node/337764 but on that issue the latest post
If your problem deals exclusively with fields or filters provided by another module .............. please post the issue under the queue for that module first; all modules are responsible for telling Views about their own fields. It's possible Views IS at fault, but the module maintainers are the best people to make that determination, and they can kick the issue into the Views queue with an explanation of what's wrong if that is the case.
seems to throw the problem from Views back to one of the modules supplying data to the Views module.
Comment #3
karens commentedThe original issue as about a postgres bug which is fixed in the new releases of Date and Calendar (rc6). #2 is an unrelated issue which is a duplicate of several others that I already marked fixed.