Make it easier to exlude fields from the form display used

Created on 19 October 2020, about 4 years ago
Updated 23 October 2023, about 1 year ago

Problem/Motivation

I had quite the debugging session trying to find out what was resetting my order object in the checkout, when I stumbled on this. I assume the same rationale was applied when deciding to remove coupons from the order fields form mode (https://git.drupalcode.org/project/commerce_checkout_order_fields/-/blob...), but when you have fields that are updated with ajax, submitting a checkout step will reset that field to the value of the field widget. One such example can be found in #3177715: Does not work together with commerce_checkout_order_fields .

Not sure how to solve this best, but ideally I would at least like to have a hook to remove fields in a similar manner as coupons is removed. So suggesting that as a first.

Steps to reproduce

See #3177715: Does not work together with commerce_checkout_order_fields

Proposed resolution

Introduce a new hook.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇳🇴Norway eiriksm Norway

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

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

  • 🇩🇪Germany Anybody Porta Westfalica

    @eiriksm any plans to add a test to finish this?

  • 🇳🇴Norway eiriksm Norway

    Well. Plans.

    No immediate plans obviously 😅 Feel free to take over anyone that feels like it ✌️ Otherwise I would love to get back to it one day I have the time 🤓

  • Status changed to Needs work about 1 year ago
  • 🇩🇪Germany Anybody Porta Westfalica

    @eiriksm thank you, yes. If someone touches this, please create a MR based on #2 to make review and merge easier. Thanks!

Production build 0.71.5 2024