Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
In the 4.x branch of Webform Module we have a new Conditionals feature that "may be used to hide or show certain components (or entire pages!) based on the value of other components".
Would be great to export these conditions with webform_share.
Thank you!
Comment | File | Size | Author |
---|---|---|---|
#4 | webform_share-conditionals-1775452-4.patch | 962 bytes | scottrigby |
Comments
Comment #1
chertzogThe conditional actions associated with Webform 7.x-4.x are already in the export, there was just nothing in the import process to accept and save them. adding the following line to
webform_share_components_update_form_submit
will import the conditional statements if they exist.It should be around line 157 of webform_share.module.
Note: this is a quick and dirty method. There should probably be some checking to make sure component IDs match up...
Comment #2
firfin CreditAttribution: firfin commentedI think there should probably be cid matchup indeed. Not much though. I imported a webform with 20 conditionals only one of which had a mismatch on a component ID.
Unfortunately I do not seem to be able to produce a minimal testcase / reproduction of the problem.
Comment #3
jonhines CreditAttribution: jonhines commented#1 works fine if you have not deleted any fields above the elements you are running conditions on. If you have deleted some webform fields, it will miss. I tried to use the above to move a form with 50+ conditional statements and 120+ conditional rules.
My content creator had deleted a field early on. Every field condition broke. I was able to update the source field in the webform_conditional_rules table via sql query but I eneded up having to manually set the targets in the webform_conditional field through the web admin interface. I don't intend to do that again.
I'll try making the matching work and submit a patch if I ever need this again but I'm probably just going to recommend that my content creators set conditional statements live in the near future.
Comment #4
scottrigby#1 works when both import checkboxes are unchecked. This is all we need for now, so attaching a patch for tracking. If you need to check the CID on existing webforms, more work would need to be done.
Comment #5
ebanford CreditAttribution: ebanford commentedTested #4 and it seems to work fine for this needed functionality.
Comment #6
Alan D. CreditAttribution: Alan D. commentedCommitted.
Cheers