0

(D7) When a user sends a friend's invitation to another user (User Relationships) the other user, once he logs in, sees a green message that informs him so-and-so sent him a friends request. There is a link that takes the viewer (requestee) to example.com/relationships/received.

However, I have created a view that displays the received requests in a different format. Of course the page view has a different path and I want the user to be redirected to: user/[uid of the requestee]/relationships/received and the requestee only to be allowed to see the requests he received.

I have created a rule (Rules module) as follows:

  • Event: A user relationship has been requested
  • Condition: Relationship has type (friend)
  • Action: Page redirect (user/[requestee:uid]/relationships/received)

[requestee:uid] is in the allowed replacement patterns but it doesn't work. Clicking on the link still takes the viewer to the original path.

What do I do wrong? :)

| improve this question | | | | |
1

If you want to redirect to the current user profile page, you could try using the redirect module with redirect_token

Use tokens in "To" paths in Redirect module.

Then you can redirect from http://example.com/relationships/received to http://example.com/user/[user:uid]/relationships/received

| improve this answer | | | | |
  • [user:uid] and [requestee:uid] don't work as tokens with redirect_token. However, [current-user:uid] does work and it's fine for my purpose. Thanks. :) – user14666 Mar 2 '15 at 2:19

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.