Crocoblock / jetformbuilder

80 stars 16 forks source link

Incorrect Product Type Overwrite in "Insert/Update Post" Action #370

Closed bcasni closed 10 months ago

bcasni commented 1 year ago

Description: While using JetFormBuilder's "Insert/Update Post" post-submit action to update an existing product, I've noticed an unexpected behavior where the product type transitions from "external" (or any other type) to "simple" without explicit modification.

The issue arises when the product type is not explicitly set within the form. Instead of retaining the existing product type, the system defaults to applying the "simple" type, contradicting the intended behavior.

Expected Resolution: I propose adjusting the system logic to preserve the current type when explicitly set within the existing product and default to "simple" only if a different type is not explicitly specified in the existing product or in the form.

Steps to Reproduce:

  1. Use JetFormBuilder with "Insert/Update Post" post-submit action.
  2. Update an existing product of a type other than "simple" using either the standard Post ID field or a direct Post ID.
  3. Observe the unexpected shift in product type from "external" to "simple" when the type is not explicitly set within the form or the existing product.

Workaround: While creating or updating a product, employ a hidden field within the form with the desired type value, mapped to Post Terms > Product Type.

girafffee commented 10 months ago

Hi @bcasni, This has been fixed in 3.2.3 version, thanks for reporting