Closed (outdated)
Project:
Webform Validation
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2011 at 14:59 UTC
Updated:
17 Apr 2026 at 20:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dsnoeck commentedHere is an update of the patch.
In this update I'm using hook_nodeapi() to update the nid field of the validation_rule after creation of the webform.
Comment #2
dsnoeck commentedForget to removed some custom debug function from the patch.
Sorry about that. Here is a cleaner code.
Comment #3
svendecabooterThanks for your patch.
I'll test it soon
Comment #4
svendecabooterHi,
I've checked this patch, but i'm not sure about the reasoning behind all of it.
What's the reason it doesn't work with prepopulate? I assume because the validation rules are not stored in the node form itself?
Perhaps I will have to re-architecture that, since that's also a problem for the node_clone support...
Also, right now the code checks for node type "webform", whereas in Webform 3.x multiple content types can be defined as webform, so that should be broadened.
The module_exists() call are also not necessary, since we are actually running the module...
If I find more time to investigate the node_export module, i'll try to clean this up some more myself.
But if you are able to do that yourself, feel free to speed up the process :)
Comment #5
alexgl commentedAny thoughts on getting this patch for 7.x users?
Comment #6
IsaMic commentedHi,
I rerolled the patch to get it working with version 6.x-1.5.
Thanks, bye.
Comment #7
pol// Forget about this comment, I double posted by mistake.
Comment #8
polHello Isa,
If you want your patch to be in the next release,...
Don't forget to convert 'tabs' into 'spaces' and set the status of the project to 'needs review' ;-)
Comment #9
malcomio commentedBased on the patch in #6, here is a version that seems to be working for me, but needs more testing.
The previous patch was not getting the new rule ID properly, so it wasn't adding the components to {webform_validation_rule_components}
Comment #10
malcomio commentedAfter a bit more testing of my patch, it seems that when you use node export directly, the validation rules come across fine.
If you use features, the validation rules aren't added when the feature is enabled, but they are added when the feature is reverted.
Ideally I'd do some more work on the module to fix this, but for the moment I don't have time, and I can achieve the desired effect by reverting the feature after enabling it.
Comment #11
benedictsteele commentedI've updated the patch in #9 to work with the 7.x branch. I've tested with manual imports and against features 2.x branch, both seem to import as expected.
Comment #12
liam morlandAre the issues raised in #10 resolved? I don't use node_export. Is there someone else who can test this and mark it RTBC if it works?
Comment #13
nicxvan commentedIt still does not work, the form is imported, but the validation isn't imported using features with either the enabling or the revert.
Node Export 3.0
Webform 4.0 alpha6
Webform Validation 1.2
Features 2.0 beta1
Comment #14
dawehnerOne general problem this approach does have is, that there might we rules with the same ID already in the database, don't you?
Comment #15
liam morlandMarking #2120773: Exporting Webform form validation with Node Export module as duplicate of this.
Comment #16
Andy_D commentedThis would be even better if it integrated with Features!
Comment #17
ladybug_3777 commentedAny progress on this? Having to enter webform validation manually on all my servers can be tedious and prone to user error. I'm using webform validation 1.7. Guess I'll do a little more looking and see if there is another post on this or if I can help with a patch.
Comment #18
joseph.olstadWe're working on this right now, a patch to follow.
Comment #19
ladybug_3777 commentedWonderful! Thank you for the update joseph.olstad
Comment #20
mmkc commentedI'm not sure how much this will help the webform validation module node export however I've created a patch for the webform_share module (not the webform_validation module) that exports rules and imports rules using the webform_share module.
Some of the logic could perhaps be used to make node export work for the webform validation module.
Specifically in the two functions:
webform_share_components_update_form_submitand
webform_share_exportComment #21
joseph.olstadJust fyi:
mmkc and I worked on a sort of related issue in the webform_share queue, see Allow webform_validation rules to be exported and imported
there is a patch, but it is for the webform_share module. We didn't realize when we were working on the issue that there were multiple modules/ways to do this so if we had realized that sooner we'd have probably done all our work on this queue instead. Not sure if this helps right now.
Comment #22
joseph.olstadFlagging related issue
Comment #23
natew commentedPatch #11 resolved this for me, I didn't see the issues described in #10 or #13.
For example when I exported the nodes in a feature, deleted the node, disabled the feature, and re-enabled the feature the nodes got imported with the validation rules. Further I was able to confirm when I deleted the node the validation rule was also deleted in the database.
Node Export 3.0
Webform 4.12
Webform Validation 1.9
Features 2.7
Note I was using the 4.5 version of the following distribution: https://www.drupal.org/project/wetkit
Comment #24
liam morlandThanks for testing this. Can anyone else confirm that it is working, preferably on a clean install?
Comment #25
natew commentedI ran into an issue where when we change the validation rules then export to a feature and import via a feature revert. The validation rules can get duplicated or don't get removed. I modified the code/patch to address this.
Comment #26
liam morlandThanks. I will be interested in see others' reviews of this.
The comment "Adds support for node_export module." is not needed. The meaning is covered in the "Implements" line below.
Comment #27
liam morlandHas this patch been working reliably for people? Is it ready to commit?
Comment #28
liam morlandSimple re-roll; review needed by node_export users.
Comment #29
liam morlandI'd like to get this committed if it is working. If you have used this, please post your success or failure here.
Comment #30
david.hughesHi Liam, I have been using this patch for a while, would love for it to be committed.
Comment #31
david.hughesComment #32
liam morlandThanks for the review. I did a coding standards check prior to commit and found a bunch of issues. In fixing those, I did a bit of refactoring. There is a now a transaction in use, so either the entire import will succeed or fail, rather than an error resulting in partial import. The insert uses a single db_insert() query. Please give it a test and review.
Comment #33
liam morlandI'd like to get this committed. It just needs a final test from a user of this feature.
Comment #34
liam morlandDrupal 7 is no longer supported. If this applies to a supported version, please re-open.