Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
when I upgraded my postgres from 8.1.x to 8.3.3, the stricter type enforcement in this blew out my 'events' view which is using Date fields...
fix is to add a cast to this code in date.inc
old code:
// Get rid of the 'T' in ISO dates to match native date field.
// This makes it possible to use SQL date functions on the value.
elseif ($date_type == 'iso' && $field) {
$field = " REPLACE($field,'T',' ')";
new code...
// Get rid of the 'T' in ISO dates to match native date field.
// This makes it possible to use SQL date functions on the value.
elseif ($date_type == 'iso' && $field) {
$field = " cast(REPLACE($field,'T',' ') as date)";
i haven't regression tested this under older versions of postgres and/or on mysql.
fyi, my content types have a a simple Date field, the site is using PDT timezone, and the view that triggered the error is using Date: Date - Date (field_date) in a filter as >= "now" - an offset
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedThis has been changed in the 5.2 version, which now uses "TO_DATE($field, 'FMYYYY-FMMM-FMDDTFMHH:FMMI:FMSS')".
Comment #2
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.