Needs work
Project:
Webform Features
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
29 Dec 2015 at 19:02 UTC
Updated:
7 Feb 2019 at 04:35 UTC
Jump to comment: Most recent
When webform is overridden and we revert the feature it creates a new webform and the feature remains overridden.
Comments
Comment #2
mehul.gadaWe faced similar issue when featuring existing webform for one of the application. On each feature revert, a new webform was getting created. On troubleshooting, we found that the webform itself was not correctly created. It had many components with duplicate machine name. So, we first deleted the duplicate webforms (those created by feature revert), and then manually corrected machine name of each webform component for original webform in database, so that each webform component has unique machine name. Once done, we cleared drupal cache and regenerated feature. This feature worked fine when we reverted it in other environment and no duplicate webform was created. Please note that machine name correction is required in both the environment (one where you will regenerate feature and one where you will revert feature.)
Comment #3
joseph.olstadhad exactly same issue as described and indeed comment #2 is correct about this. the webform table rows must have a machine_name. For some reason in my case there was none there.
if you take the machine names from the duplicate webforms and correspond those to the pre-existing ones that have no machine name, you'll find out which machine names to use for which row.
SELECT nid, confirmation, status, machine_name FROM webform WHERE nid = 12345 OR nid = 54321 ;assuming 12345 is the webform nid you want to fix
assuming 54321 is the new duplicated webform that you just want to find out which machine name to use then delete that webform.
To fix manually:
UPDATE webform SET machine_name = 'example_machine_name_check_new_duplicate_webforms_for_name' WHERE nid = 12345 AND machine_name ='';in my custom feature I added this to the cool_feature_with_forms.install file:
Once you've added the hook_update then go to update.php and it'll roll, or else do
drush updbComment #4
vensiresEven though the solution in #3 may work, it needs a developer to customize things and know what he's doing since it's relevant to each webform. It also requires the developer to create a new update hook each time the feature gets regenerated.
Comment #5
aubjr_drupal commentedDoes this get fixed by the suggestion at https://www.drupal.org/project/webform_features/issues/2572991#comment-1... ?