0

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.`

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.