1

I've created a content type 'H'. The following rule (using the Rules module) has been built to prevent the node from being saved/updated if the field 'a' is larger than 5.

Event: Before saving content of type 'H'.

Condition: Data Comparison - Node field 'a' is larger than 5.

Action: Show a message on the site - Message type: Error.

Action: Go back to the front page.

It will show the error message if the condition is TRUE. However, the node is still being saved/updated.

Is it possible to control this without programming?

0

I'm not aware of a way to do what you're asking for by only using the Rules module ... And the (old) issue about "Prevent Node from being saved" (with confusing status "Closed (fixed)" ...) somehow seems to confirm you'd need "a bit more" ...

You can try to make it work by ALSO using the Conditional Rules module for this. Some more details about this module (from its project page):

... provides Rules plugins for conditionally altering execution flow directly inside a group of actions.

Here is a screenprint of a rule with an action that uses Conditional Rules (though only with an "if"-part here, no "else"):

enter image description here

  • Thank you. I use the 'Conditional Rules' to build the rules. Actually I want to do is that ==> 1. The user create a node 'H' and input a decimal field 'a', 2. After clicking the 'save' button (but before saving the node), the following rule will be checked. Rule: If 'a'>5, print error and quit, otherwise save the node 'H'. However, the node was saved when the error is shown. In other words, it will save the node if the condition is FALSE when the Event = 'Before saving the content'. – mms Nov 25 '15 at 2:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.