Closed (fixed)
Project:
e-Commerce
Version:
5.x-3.x-dev
Component:
paypal
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 May 2008 at 20:21 UTC
Updated:
24 Nov 2008 at 02:28 UTC
Hi,
I am getting the following error:
array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in /home/afana/public_html/drupal5/modules/mimemail/mimemail.inc on line 106.
and this apparently related error:
array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in /home/afana/public_html/drupal5/includes/common.inc on line 1955.
which references these lines in common.inc:
$defaults['From'] = $defaults['Reply-To'] = $from;
}
$headers = array_merge($defaults, $headers); <===== line 1955
// Custom hook traversal to allow pass by reference
It seems that PHP is having issues with the $header variable.
These errors seem to have cropped up since my host server was upgraded to PHP 5.2.6 but that may or may not be related.
Comments
Comment #1
sutharsan commentedWhich module is sending an email that causes this error?
Can you find out what the content of the Argument #2 is? The one reported in modules/mimemail/mimemail.inc on line 106. (use var_dump() to print the variable).
Comment #2
rkdesantos commentedThe most recent incidences of the error were triggered by the Paypal module (submodule of eCommerce) when it triggers an IPN transaction (IPN is a Paypal feature). There are no errors on the PayPal end though the e-mail that results is not properly mime encoded and the following content is inserted in the body without the proper header content lines being set:
IF (big if) I placed the var_dumps at the right place in the mimemail module this what I got back (email addresses obscured):
array(1) { ["mail"]=> string(18) "axxxxx@xxxxx.com" } object(stdClass)#110 (24) { ["uid"]=> string(4) "1278" ["name"]=> string(9) "Test User" ["pass"]=> string(32) "ae2b1fca515949e5d54fb22b8ed95575" ["mail"]=> string(18) "axxxxx@xxxx.com" ["mode"]=> string(1) "0" ["sort"]=> string(1) "0" ["threshold"]=> string(1) "0" ["theme"]=> string(0) "" ["signature"]=> string(0) "" ["created"]=> string(10) "1208038831" ["access"]=> string(10) "1208039180" ["status"]=> string(1) "1" ["timezone"]=> string(6) "-14400" ["language"]=> string(0) "" ["picture"]=> string(0) "" ["init"]=> string(18) "axxx@xxxxxxxxx.com" ["data"]=> string(142) "a:5:{s:7:"display";s:1:"2";s:19:"mass_contact_optout";i:0;s:12:"current_date";s:10:"1202834503";s:10:"current_id";s:2:"11";s:7:"contact";i:1;}" ["login"]=> string(10) "1208039037" ["display"]=> string(1) "2" ["mass_contact_optout"]=> int(0) ["current_date"]=> string(10) "1202834503" ["current_id"]=> string(2) "11" ["contact"]=> int(1) ["roles"]=> array(1) { [2]=> string(18) "authenticated user" } }I dumped these variables:
May or may not help but I have also tied it to this error:
Invalid argument supplied for foreach() in /home/afana/public_html/drupal5/modules/mimemail/mimemail.inc on line 21.Comment #3
rkdesantos commentedComment #4
sutharsan commentedIt is the $headers variable in mimemail_rfc_headers() which causes the problem. It should be an array and is a string.
I have found an error in the 5.3 version of the ecommerce paypal module.
The header definition on line 419 of paypal.module is wrong:
And should be (not tested):
Transfering this issue to e-commerce module issue queue.
Comment #5
rkdesantos commentedI tested the above change and now I longer get any errors however I no longer get the debug e-mails at all.
Comment #6
rkdesantos commentedAny further info required on this? Status of a fix?
Comment #7
rkdesantos commentedIs any work on going with v3.4 any longer? Will this bug be fixed?
Comment #8
rkdesantos commentedThis issue is still present in v3.5.
Comment #9
rkdesantos commentedStatus? Can this fix be included in v3.6?
Comment #10
davea commentedTry the latest version of ec 5.x.3.x-dev and let me know the results.
Thanks,
DaveA
Comment #11
rkdesantos commentedInstalled the 5.x.3.x-dev release and so far, so good. The errors haven't returned.
Thanks for giving this some attention.
Comment #12
davea commentedreopen if you need to
Thanks,
DaveA