Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-13230

using some dates as contextual filters in drupal views generating php warnings

    Details

      Description

      With CiviCRM 4.3.5, Drupal 7.22 and Views 7.x-3.7 and creating a CiviCRM Events view in Drupal with a Contextual filter of Start Date Month (for example) I get the following warnings:

      Warning: timezone_open(): Unknown or bad timezone (0) in format_date() (line 1976 of ####/includes/common.inc).
      Warning: date_timezone_set() expects parameter 2 to be DateTimeZone, boolean given in format_date() (line 2014 of ####/includes/common.inc).

      Seems to be triggered by the calls to Drupal's format_date() function, Drupal is expecting NULL when using the default timezone and 0 is being interpreted as a timezone id

      Is it safe to remove the last argument to those function calls? ie.
      return format_date(strtotime("2005" . $month . "15"), 'custom', $this->format, 0);
      becomes
      return format_date(strtotime("2005" . $month . "15"), 'custom', $this->format);

      civicrm files that are affected:
      views_handler_argument_civicrm_month.inc
      views_handler_argument_civicrm_day.inc

      I'm getting a "Broken missing handler" when using the "full date" handler but I'll create another issue for that once I look into it further (and figure out if it's not just me).

        Attachments

          Activity

            People

            • Assignee:
              monish.deb Monish Deb
              Reporter:
              rowead Andrew Rowe
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: