Problem/Motivation

After running commerce_webform_order_post_update_1() some of the resulting webforms have completely messed up configuration. Sections are broken, fields get translated to the wrong language, some field types are gone...

Steps to reproduce

Just run the update having some existing webforms with the 'commerce_webform_order' plug-in enabled.

Not sure if it has anything to do but on this site we have multilingual webforms and also some webform templates.

Proposed resolution

It looks like the updating mechanism for the plug-in settings is not safe for language or configuration overrides.

Since webforms are configuration entities, instead of Webform::load(...)->save() we should be using ConfigFactory:getEditable(...)->save()

Patch will follow.

Comments

Jose Reyero created an issue. See original summary.

jose reyero’s picture

Status: Active » Needs review
StatusFileSize
new1.44 KB

This patch should fix it.

Not sure whether the update could be simplified just using the configuration data... However I've kept the whole plug-in-settings + defaults update code just to make sure the resulting settings are exactly the same....

  • facine committed 5be337c3 on 3.x authored by Jose Reyero
    Issue #3388517 by Jose Reyero: Broken webform configuration after update
    
facine’s picture

Status: Needs review » Fixed

Fixed, thank you very much :)!

Status: Fixed » Closed (fixed)

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