Improve inline form support for ief

Created on 3 February 2022, almost 3 years ago
Updated 24 February 2023, over 1 year ago
  • Initial issue: Commerce inline forms are not submitted via ief actions (i.e.: in a promotion referenced via an ief widget, the offer and conditions fields configuration is not properly formed on submit and not saved if the ief is closed).
  • Added: hook_commerce_inline_form_alter() is not fired when the inline form is nested in an ief.
📌 Task
Status

Needs review

Version

2.0

Component

Commerce

Created by

🇫🇷France nicolasgraph Strasbourg

Live updates comments and jobs are added and updated live.
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.

  • Patch works in Commerce Core 8.x-2.33. Thanks! We can close my issue as a duplicate of this one if you would like.

  • 🇮🇱Israel jsacksick

    @NicolasGraph @tonythefer: Care to provide some information about the bug? Reproducible steps? It's unclear to me what the problem is by reading the initial report.

  • Yeah. This is a duplicate of my issue that's referenced.

    Here is the steps from my issue:

    Steps to reproduce
    Create a simple product type see commerce documentationAt admin/commerce/config/product-types/simple_product/edit/form-display, set the widget for the "Variations" field to "Single variation (Product information)"Add a product entity reference field to any content type, referencing your simple product type. Set the widget to "Inline entity form - Complex". At admin/structure/types/manage/MY-CONTENT-TYPE/form-display I am checking both Allow users to add new product entities & Allow users to add existing product entitiesProblem/Motivation

    When editing existing products and product information in the IEF and clicking Update Product, changes to the product are saved, but changes to the product variation are not saved.

    If you take the IEF out of the equation by navigate to the product itself product/*/edit, you can modify the nested variation and the Save button updates the variation as it should.

    If you edit and update the product variation in the IEF widget on the node by leaving the widget open and saving the node, it updates the variation as it should.

  • 🇷🇴Romania silviuchingaru

    I don't quite understand either but, as far as I understand, seems more related to 🐛 Changes are lost when collapsing a paragraphs subform including an inline_entity_form Needs work .
    Can you please check if that patch on IEF module solves the problem?

  • 🇫🇷France nicolasgraph Strasbourg

    @SilviuChingaru, the patch you mentioned does not fix this issue.

    @jsacksick, in my use case I reference a promotion in a custom entity (but the problem is the same if you try to reference a shipping promotion in a product for example). When using an ief widget, the promotion offer configuration and promotion conditions are not saved when using the ief submit before to submit the whole parent entity form. However, everything is right when saving directly the parent entity form.

Production build 0.71.5 2024