An empty value in the element array results in a "Fatal error: Unsupported operand types".

Patch attached.

Comments

orakili’s picture

Sorry, wrong patch.

Please find attached a new one, compatible with drush make.

sharplesa’s picture

orakili,

Should the element *not* be updated at all if it's empty? Why didn't you do something like this:

   foreach (element_children($element) as $index) {
-    $element[$index] = $properties + $element[$index];
-    $element[$index] = messaging_template_pre_render_element($element[$index]);
+    if (empty($element[$index])) {
+      // Initialize this element
+      $element[$index] = $properties;
+    }
+    else {
+      // Add properties to the element
+      $element[$index] += $properties;
+    }
+    $element[$index] = messaging_template_pre_render_element($element[$index]);
   }

Could you provide test procedure for verifying that the patch accomplishes its intended goal?

Thanks!

danepowell’s picture

Status: Needs review » Needs work