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 get the following error when a user checks out a subscription product:
Unable to modify data "account:field-commerce-sp-validity": Invalid data value given. Be sure it matches the required data type and format.
I've only tested this with anonymous users. I have the latest versions of the required modules (not dev)
Comments
Comment #1
fagohm, not sure what's happening here. Maybe make sure the value which is to be set is really a date.
Comment #2
fagoComment #3
droweski CreditAttribution: droweski commentedAppears to be simple matter of rule weights in checkout rules.
Default weight of zero triggers rule before account creation.
Edit the "Apply bought subscription time" rule to apply more weight (larger number), so that it triggers after new account has been created and error is gone!
Fago, you do fantastic work, thanks!
Comment #4
droweski CreditAttribution: droweski commentedPS:
As fago notes, recommended to use features_override to manage change to rule weight, since any upgrade will revert changes you have made.
Comment #5
mrconnerton CreditAttribution: mrconnerton commentedI don't think this is an issue anymore
Comment #6
kt2ssh CreditAttribution: kt2ssh commentedI got this error when the rule "Apply bought subscription time to user subscription validity" is triggered by paypal ipn (anonymous user) , it cannot set a data value , seems permission issue , it got this error.
Unable to modify data "account:field-commerce-sp-validity": Invalid data value given. Be sure it matches the required data type and format.
If that rule is triggered by admin , the field-commerce-sp-validity changed successfully .
Anyone got this issue ?
Comment #7
kt2ssh CreditAttribution: kt2ssh commentedSorry , this was my problem , the line item was added to the order programmatically and missing the order id ...
the rule is failed due the missing line item:owner.