Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm getting this message after selecting "Continue to next step" on the Review Order page.
Warning: Illegal offset type in commerce_subscription_form_commerce_paypal_wps_redirect_form_alter() (line 1241 of *****/sites/all/modules/commerce_subscription/commerce_subscription.module).
The error displays for a few seconds and then I am redirected to the Paypal site.
Any idea what is causing this and how I can correct it?
Comment | File | Size | Author |
---|---|---|---|
#1 | commerce-subscription-property-collision-1438198-1.patch | 4.38 KB | DuaelFr |
Comments
Comment #1
DuaelFrI have the same issue and after reading the code I think it is not easilly fixable.
In fact, the module defines a field and a property with the same name "subscription_trial_period". The issue is that despite of the fact that a custom getter has been defined on the property, Drupal gets the value directly from the field.
As I said, the issue is a bit painful because the most proper way to fix it would break the backward compatibility.
Here is a quick fix for this issue. It is far from perfect but it seems to work.
Comment #2
DuaelFrComment #3
Tiam . CreditAttribution: Tiam . commentedI found the actual reason is cause by $product_wrapper->subscription_trial_units->value() returning an array which is
array([0]=>4);
$units = array(
COMMERCE_SUBSCRIPTION_DURATION_DAYS => 'D',
COMMERCE_SUBSCRIPTION_DURATION_WEEKS => 'W',
COMMERCE_SUBSCRIPTION_DURATION_MONTHS => 'M',
COMMERCE_SUBSCRIPTION_DURATION_YEARS => 'Y',
);
Which mean the value we need here is array(4)