• 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.

Comments

NicolasGraph created an issue. See original summary.

nicolasgraph’s picture

Here is the patch I generated today. Needs more tests but seems to work.
Should we test that ief is installed in the new condition?

nicolasgraph’s picture

Status: Active » Needs review
nicolasgraph’s picture

Issue summary: View changes
nicolasgraph’s picture

While the plugin configuration is now correctly saved on ief submission, I faced to another issue : hook_commerce_inline_form_alter() is not fired when the inline form is nested into an ief.
Here is a new patch to fix that.

nicolasgraph’s picture

Title: Promotion offer configuration not correctly set via ief » Improve inline form support for ief
nicolasgraph’s picture

Issue summary: View changes
nicolasgraph’s picture

Assigned: nicolasgraph » Unassigned
tonytheferg’s picture

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.

jsacksick’s picture

@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.

tonytheferg’s picture

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.

SilviuChingaru’s picture

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

nicolasgraph’s picture

@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.

jsacksick’s picture

Status: Needs review » Closed (won't fix)

I'm going to mark this as "won't fix" as we're trying to move away from the IEF module (which still doesn't have a stable release).

We're getting closer to that thanks to the new order items widget introduced in #3403314: Define a new widget to simplify adding products to orders from the edit page.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.