I have a site that uses PostgreSQL. When setting up a date-pager (a component of the date_view module), suddenly my site gets these errors:

PDOException: SQLSTATE[22023]: Invalid parameter value: 7 ERROR: time zone "US/Central" not recognized: SELECT '2008-02-15 12:00:00 UTC' AT TIME ZONE 'US/Central'; Array ( ) in date_sql_handler->db_tz_support() (line 112 of /home/myuser/public_html/sites/all/modules/contrib/date/date_api/date_api_sql.inc).

This site was imported as-is from another installation, on a server where they had already configured Postgres, and this error did NOT occur there, when I set up the date pager following the exact same procedure (create a date contextual filter, then enable paging by date). My new (shared) host is in the "US/Central" timezone, so I suspect this is due to something to do with their Postgres config.

The error is happening at a place in the code where it is doing this: "See if the db has timezone name support." Clearly, in my case, the db does NOT have timezone name support, but this fact is getting clobbered by an exception.

CommentFileSizeAuthor
#3 date-pdoexception-2453445-2.patch833 bytesrahul.nahar001
#1 date-pdoexception-2453445-1.patch819 bytesdan3h
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch date-pdoexception-2453445-1.patch. Unable to apply patch. See the log in the details link for more information. View
Membership dollars fund testing for the Drupal project. Drupal Association Learn more

Comments

dan3h’s picture

Status: Active » Needs review
FileSize
819 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch date-pdoexception-2453445-1.patch. Unable to apply patch. See the log in the details link for more information. View

Fix attached -- simply adds exception-handling to the test.

Status: Needs review » Needs work

The last submitted patch, 1: date-pdoexception-2453445-1.patch, failed testing.

rahul.nahar001’s picture

Status: Needs work » Needs review
FileSize
833 bytes

Please find updated patch file.