1

I'm currently stuck in the creation of a custom rule. I've created a content type "Avviso" with a publishing date field (start & end) and a custom field_stato with this values:

  • Not active
  • Active
  • Terminated
  • Archived

Now I would like to change the value of field_stato and publish all nodes with date_start < now < date_end. For that I've created a view with a VBO field, a Rule (triggered by the cron) and a component (of type rule) that do the job.

The problem is that the rule can see only node already published and -of course- cannot switch the node itself to "Published" state. With already published nodes the rule works fine.

Is there any restriction or permission with rules and unpublish content=?

(see images) Rule Component

4
  • For the rule-component interaction, I've followed this guide: drupal.org/node/1386746#comment-9738271
    – Carlo
    Oct 28, 2015 at 16:33
  • You probably need to look at the VBO view and make sure that it is not restricted by "Published" Oct 28, 2015 at 17:38
  • No, my view has not any filter on published/unpublished state.. :-(
    – Carlo
    Oct 29, 2015 at 8:18
  • Hi, would you mind take a look at my issue here: drupal.stackexchange.com/questions/212173/…. I just need to change a field value but I can't figure out how... And as I can see you already did that. Would you mind explaining how? thank you!
    – Drii7
    Aug 24, 2016 at 18:40

1 Answer 1

0

Cron runs as an anonymous user. Ensure that the view permissions allow an anonymous user to access. Set the access to role:

Permission dialog box for views

Then, set the role to anonymous:

enter image description here

That should allow you to bypass the regular permissions that would normally not allow you to see it.

Also, ensure that your rule includes a rule to save the entity. I'm not 100% sure that it will save the entities you reference automatically, but it is more clear.

Also also, you may need to check the permissions on your rules to ensure that they can be executed by anonymous as well:

rules access bypass

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.