Active
Project:
Webform Rules
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
22 Dec 2010 at 19:38 UTC
Updated:
8 Sep 2019 at 14:39 UTC
Jump to comment: Most recent
In Drupal 6 this was quite easy but with Rules-7.x some things have changed.
Idea by fago:
Wrap your data, inherit from EntityMetadataWrapper and create a custom wrapper class containing your custom save() method. It could be built very similar to the EntityDrupalWrapper (see entity API).
If we have that in place ... we just need to fix RulesState::isSavable() accordingly, e.g. we could introduce an interface or even provide your custom wrapper with Rules ...
This is the way to go! Yeah!
Comments
Comment #1
wizonesolutionsIs this still in the plans? It seems like an event for "before a Webform submission is saved" is needed. If there is no explicit hook, you could just add a
#submithandler to the relevant forms. Not sure how you'd react programmatically — maybe by implementing a query alter hook.It'd be great to use Webform Rules as an enhanced version of the Conditionals tab in 4.x.
Comment #2
bisonbleu commentedAnother way to achieve this without Rules is to create a custom module in which you implement
hook_webform_submission_presave().Here is the example from /sites/all/modules/webform/webform.api.php: