Fatal error: Unsupported operand types in /htmlmail.module on line 104
I read the code and I don't understand wath the module want to do but its very strange!

function template_preprocess_htmlmail(array &$variables) {
  $message = $variables['message'];
  $variables += $message;

The operator doesn't exist for array no? And it's strange to take a cel of this tab to put again in .

Comments

musa.thomas’s picture

Just for more information, I've got SimpleNews module, when I make var_dump of $message, the result is ok but always the fatal error at the end of page; and if I disbale this ligne all disapear (all content)

pillarsdotnet’s picture

Status: Active » Needs review
StatusFileSize
new635 bytes

Try this patch and see if it makes any difference.

musa.thomas’s picture

I will try your patch but the error is that the operator "+=" can't be relevant on an array..... I don't think it's a question of isset or empty; if it was the error should be like Parse error: parse error, unexpected T_VARIABLE in and not an operator error. http://php.net/manual/en/language.operators.array.php

pillarsdotnet’s picture

(sigh) I shouldn't have to explain this, but the += operator is valid for arrays. If it were not, Drupal core would break in hundreds of places.

The following code:
$a1 = array('a' => 'a', 'b' => 'b', 'c' => 'c');
$a2 = array('1' => '1', '2' => '2', '3' => '3');
$a3 = array();
echo "Start with an empty array.\n";
print_r($a3);
echo "Append a few letters.\n";
$a3 += $a1;
print_r($a3);
echo "Append a few digits.\n";
$a3 += $a2;
print_r($a3);
Produces the following output:
Start with an empty array.
Array
(
)
Append a few letters.
Array
(
    [a] => a
    [b] => b
    [c] => c
)
Append a few digits.
Array
(
    [a] => a
    [b] => b
    [c] => c
    [1] => 1
    [2] => 2
    [3] => 3
)
jacob.embree’s picture

Issue summary: View changes
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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