Rule to resave a node once a comment is published.

Events happening in the community are now at Drupal community events on www.drupal.org.
jjma's picture

I'm not sure about this but I am trying to set up a rule that resaves a node whenever a comment (on that node) is published.

Is this possible?

Jon

Comments

Why would you want/need to do

Bob Newby's picture

Why would you want/need to do that?

Based on a complex calculation

jjma's picture

We have a node based system using five star that creates a average calculation based on the submitted comments (using fivestar). Unfortunately the calculation needs the node to be saved once a user has submitted a five star entry to make the calculation.

Jon

So you are displaying the

Bob Newby's picture

So you are displaying the 5-star average ranking of a node's comments as a ranking of the node itself...

Simple. Using Rules, on each comment save (or perhaps publish) event, your rule loads the node; its id is readily available from the comment. Then using Rules' set a data value, you reset the node's 5-star ranking based on your function that recomputes it. Then save the node, which now reflects the updated ranking.

Bit Baffled.

jjma's picture

Thanks for your response and sorry for my late reply.

I am a novice when it comes to rules so can I ask that I take it step by step. So a user posts a comment and a vote on the node.

What do you mean when you write "your rule loads the node"?

thanks,

Jo

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: