1

I use the Content Approval module for queue for approval content. If users add article, there's no problem as it is unpublished then . I'm admin i publish this content later. But, then when user update the published content it isn't unpublished again. How can I do this?

2

If you're using the Rules module, here's a simple rules export for the purpose.

  • Event: node_presave
  • Condition: authenticated user
  • Action: unpublish node

You could change the role condition to suit your site user config.

e.g: Add the role condition "Adminstrator" and click the "Negate" checkbox for "NOT Administrator role" condition.

You could also, for example, add a Rules action to show a message under "System > Show a message on the site" after unpublishing the node.

rules screenshot

Exported Rule:

{ "rules_unpublish_updated_content" : {
    "LABEL" : "Unpublish updated content",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules" ],
    "ON" : [ "node_presave" ],
    "IF" : [
      { "user_has_role" : {
          "account" : [ "site:current-user" ],
          "roles" : { "value" : { "2" : "2" } },
          "operation" : "OR"
        }
      }
    ],
    "DO" : [ { "node_unpublish" : { "node" : [ "node" ] } } ]
  }
}

You can import the Rule at:

/admin/config/workflow/rules/reaction/import

  • okay i understand you but the problem is authenticated user update node then unpublished after admin publish it. But i have the problem authenticated role,,adminstrator role. Admin have role adminstrator and also authenticated role so when admin publish unpublished node then unpublished again. How can i add condition to rules if user have role adminstrator then not unpublish? – turkaze Jan 2 '13 at 17:22
  • 1
    Add the role condition "Adminstrator" and "Negate" for "NOT Administrator role" condition – David Thomas Jan 2 '13 at 21:00
  • Sorry, i forget ask one problem. Everthing is ok now but is it possible to set message for this rule? The default screen is now says your not authorized to see this page you must register after updating. But users now registered. Is it possible to set message after updating forexample: your content must approved by admin. Thanks. – turkaze Jan 2 '13 at 23:00
  • 1
    Yes, you can add a Rules action to show a message under "System > Show a message on the site" after unpublishing the node. – David Thomas Jan 2 '13 at 23:14

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.