Does not work together with commerce_checkout_order_fields

Created on 19 October 2020, over 4 years ago
Updated 6 August 2024, 8 months ago

Problem/Motivation

If you have commerce_checkout_order_fields, that module will try to run validate functions on its form mode enabled fields. Since giftcards is a base field, it is not possible to disable it in the UI, so the validate function ends up "poisoning" the order object of the form when its doing validation (since after we have added the card via ajax, the widget itself contains 0 items in its entity reference field.

I would say that this is a kind of flaw in the checkout order fields module as well, and its actually no easy way to tell that module to exclude the field either. This must also be somewhat knows, since it has a hardcoded workaround for coupons:

https://git.drupalcode.org/project/commerce_checkout_order_fields/-/blob...

What we could do at least, is to remove the field from a checkout form mode.

Steps to reproduce

Enable both giftcard and order fields and make the checkout panes on the same step.

Proposed resolution

Make sure we do not run validation and poison the order object

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡΄Norway eiriksm Norway

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024