Closed (fixed)
Project:
Commerce PayPal
Version:
7.x-1.x-dev
Component:
PayPal WPP
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
30 Aug 2011 at 23:11 UTC
Updated:
16 May 2024 at 00:51 UTC
Comments
Comment #1
rcharamella commentedI installed the module and got the same result. I then ran Update and found that Commerce had an update available. Once I updated Commerce, I was able to access the settings for PayPal WPP.
Comment #2
summit commentedHi,
I have exactly the same fatal error:
I do not have an update available, so that is not a solution.
I think I found the solution! There was a typo with +=
Should be:
greetings, Martijn
Comment #3
dpolant commentedIt seems like a better way to fix this would be to change the function definition
... to
That way there's no possibility of php trying to += a NULL and an array and getting upset. As I look at it there is probably a reason to use += rather than = because $settings might have something important in it when it is passed in.
Comment #4
rszrama commentedHmm, we actually do want to use the += operator, but Commerce core is supposed to be fixed to always pass in a value here... can you confirm what what version of Drupal Commerce you're running if you're seeing the bug? If you're not on 1.2, please update (reading the release notes and running update.php - don't forget to backup) and let me know if the error still occurs?
Comment #5
rszrama commentedI reviewed the core code again and confirmed that the plugin we added for payment method configuration will always send an array as the default value. Still, I don't know why we don't just use dpolant's suggestion to put the default as an array in the function signature. That alone wouldn't be enough to capture an error in the event that the function was called with a non-array value for the parameter, though. Interestingly, the WPS module gets around this by casting $settings to an array before unioning to the default values. That module doesn't use a separate function to define defaults, though, so I'm going to update that silliness so these two modules match.
Commit: http://drupalcode.org/project/commerce_paypal.git/commitdiff/14078e4