Add/assign same Five Star rating to author while adding to Article using Rules

by usmanjutt84   Last Updated April 14, 2019 23:07 PM

I Need to achieve this functionality only with Rules or combinations with any other module(s).

Structure

FiveStar field is attached to the node type Article and another with the User profile.

Requirement

When an user add rating for the Article it should apply the same rating for its author. The rating of the author on his profile must be functional as a regular rating i.e. the user can receive multiple ratings and an average is shown.

I have tried with the below Rules:

{ "rules_author_rating" : {
  "LABEL" : "Author Rating",
  "PLUGIN" : "reaction rule",
  "OWNER" : "rules",
  "REQUIRES" : [ "rules", "voting_rules" ],
  "ON" : { "voting_rules_insert_node" : [] },
  "IF" : [
    { "node_is_of_type" : { "node" : [ "node" ], "type" : { "value" : { "article" : "article" } } } }
  ],
  "DO" : [
    { "data_set" : {
        "data" : [ "node:author:field-author-rating" ],
        "value" : [ "node:field-node-rating" ]
      }
    }
  ]
}

}

But it logs an error

Unable to modify data "node:author:field-my-rating": Invalid data value given. Be sure it matches the required data type and format. Value at node(3)->author->field_author_rating: 80.`

Tags : 7 rules rating


Related Questions


Updated March 28, 2015 06:02 AM

Updated June 17, 2015 23:03 PM

Updated July 06, 2016 09:03 AM

Updated May 25, 2016 08:03 AM

Updated September 11, 2017 20:07 PM