1

I am using the User Relationships module for my Drupal7 site. I have created a one way relationship with reciprocal by the name "Follower". So if User A can be followed by User B. Also, User A can follow User B. Now i set out in the process of creating a default relationship. I did that but it works only one way. I want that by default all user follow and are followed by the ADMIN. the default relationship that i created through the CMS works fine but it works only one way. I see that Admin is following the users but not vice-versa. Also, this happens only for new users of the site. I do not see old users having that default relationships. How can i achieve that? Any suggestions.

  • i tried with Rules but to no effect... – why May 6 '13 at 10:46
0
+50

I was able to achieve this with rules + user relationship rules modules.

Export:

{ "rules_follow" : {
    "LABEL" : "follow",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "user_relationships_rules", "rules" ],
    "ON" : [ "user_insert" ],
    "DO" : [
      { "user_relationships_rules_action_create_relationship" : {
          "relationship_type" : "1",
          "requester" : [ "account" ],
          "requestee" : "1",
          "approve" : 1
        }
      }
    ]
  }
}

Rule Details:
Event: After saving a new user account

Conditions: None

Action: Request, create or approve relationships between users

Rule Settings:
Relationship Type: [your defined relationship] (follower)

Requestor: (Data Selection Method) Data selector "account"

Requestee: (Direct input mode) "1" (or the user ID of your admin account)

Approve Relationship: TRUE

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.