- Issue created by @jorgik
- Status changed to Needs review
5 months ago 2:50pm 16 July 2025 - 🇮🇳India saiprasad_g
This patch enhances the Webform::deleteElement() method to automatically remove any #states conditions referencing deleted elements, clean up related submission data, and notify administrators of affected fields. It also updates the UI confirmation message to clearly warn that all related conditions will be removed.
Steps to Reproduce (Before Patch)
Create Webform with:
Element A (e.g., checkbox or select)
Element B ,C,D(e.g., textfield) with a visibility condition on Element A, if Element A checked.
Save the Webform.
Delete Element A and save.
Observe that Element B,C,D still has broken #states, resulting in incorrect visibility.Steps to Verify (After Patch)
Delete Element A.
All references to it in conditions (#states) across the form will be removed.
A warning appears listing affected fields whose conditions were cleaned.
A warning appears listing affected fields whose conditions were cleaned. - 🇺🇸United States jrockowitz Brooklyn, NY
I am very hestitant to alter #states logic of elements when an element is deleted.
I am not sure this is major issue for most sites and might not be worth addressing.