Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49212

Using Rules for Node Validation

$
0
0

I have been using Rules a lot lately and I absolutely love it! The one place I felt it was lacking, though, was that it didn't have the ability to intercept node validation, to trigger rules that ensure that a node a user is submitting matches some complex criteria. So, I wrote a module to do just that!

My module is called "Node Validation Rules", and it provides a trigger called "Content is going to be validated" and an action called "Display a validation error". When a triggered rule is added with that trigger, it can execute the action if the node edit should be held up, and the message it provides is displayed to the user. The action can even supply the identifier of the form element that is at fault, and Drupal will highlight it in red, just like for any other form validation error.

I was going to release this as a separate module on Drupal.org, but I figured I'd release it here first to see what you guys think. Should this be a separate module?

The module can be downloaded from http://drupal.org/files/issues/rules_node_validation-take3.zip.


Viewing all articles
Browse latest Browse all 49212

Trending Articles