Strict warning: Creating default object from empty value in date_handler_fields() (date/date/date.module).

Comments

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new8.44 KB

Looks like we got some white space fixes as well in here.

This is the important part

@@ -658,6 +658,9 @@ function date_prepare_node($node, $field, $type_name, $context, $options) {
 function date_handler_fields($view) {
   $field_names = array();
   if (empty($view->date_info->date_fields)) {
+    if (empty($view->date_info)) {
+      $view->date_info = new stdClass;
+    }
     $view->date_info->date_fields = array();
   }
   foreach ($view->field as $field) {
patricksettle’s picture

Priority: Normal » Minor
StatusFileSize
new506 bytes
new506 bytes

Here's a clean patch with just the important part.

Also, for those who need it... a patch for 2.8

karens’s picture

Status: Needs review » Postponed (maintainer needs more info)

Unable to see any place that this happens. Do you have steps to reproduce?

karens’s picture

Status: Postponed (maintainer needs more info) » Fixed

Oh never mind, it makes sense even if I can't reproduce it. Thanks!

http://drupalcode.org/project/date.git/commit/66454f2

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

iantresman’s picture

date-1223956-2-d6-2x.patch worked for me (PHP 5.4.19, D6.22, Views 2.16, Date 2.7). I was also getting strict warnings with Views, which I was able to solve here.