3

I have the following problem that I don't seem to be able to solve myself:

Today user BRIAN feels like creating some content, let's say 5 articles. I created a rule using the RULES MODULE that automatically assigns him the role CONTRIBUTOR after creating the first article.

Tomorrow Brian will realize that 4 of his articles weren't that great, and he decides to delete them. No problem, there is still one article out there authored by him and Brian is still a contributor! HOWEVER, as soon as Brian also deletes his very last piece of contributed content, I want him to lose his contributor role.

How do I put this into a rule?

On Brian's user profile, there is a VIEWS block listing all of Brian's content. The RULES BONUS PACK (http://drupal.org/project/rb) would let me check the number of results of this block and remove his contributor role as soon as the number of results drops down to 0. However, the module is still in development and I really don't want to use a dev-version on a productive website.

I read somewhere that the VIEWS BULK OPERATIONS module could do the job, but I really wouldn't know how. Could someone give me a hint, please?

2
  • Have you looked at User Points? I haven't used it, but it seems that with it, UserPoints Contrib and UserPoints Nodes and Comments, you could get rules integration and auto role assignment: drupal.org/project/userpoints
    – keva
    Commented Sep 12, 2012 at 18:24
  • Thank you, that's a good hint. However, it would definitely be more elegant to read out the number of entities in a view and then trigger a rule than read out a number of user points for creating content and then trigger a rule. The view is already there anyway!
    – deinqwertz
    Commented Sep 15, 2012 at 20:40

1 Answer 1

1

Checkout the rules bonus pack

Conditions

  • Check number of results from a view: This condition loads a view and checks the number of results – condition is passed if it is at least as many results as you set. You can pass on arguments to the view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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