This is heavily related to the issue reported by Berdir here: https://www.drupal.org/node/2857051

I think the same (or almost the same) issue is occurring with the PaymentGatewayForm element, which itself embeds ProfileSelect elements and other dynamic fields.

When testing changes to the ProfileSelect element, it behaves properly in the context of Shipping Information, but the form values seem to refresh an extra time with default values again when in the context of a payment gateway form.

After bringing up in Slack, bojanz suggested that the payment gateway form should extend RenderElement instead of FormElement, just like the related issue did for the ProfileSelect element.

A PR is in the works for testing and review. Verifying that it resolves my issue first, and will have it posted shortly if it seems to work.

Comments

bmcclure created an issue. See original summary.

replicaobscura’s picture

Issue summary: View changes
replicaobscura’s picture

PR submitted, seems to fix the issue for me without doing anything further.

https://github.com/drupalcommerce/commerce/pull/724

replicaobscura’s picture

replicaobscura’s picture

replicaobscura’s picture

Status: Active » Needs review
bojanz’s picture

Status: Needs review » Fixed

Makes sense, IEF itself extends RenderElement, that's where we got it from. Merged.

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.