The presave $op from hook_user_relationships gets called both when a relationship is requested and approved.

If I output the relationship object at the time of the request it contains a full user object for both the requestee and the requester, but at the time of approval it contains a much more limited object seen in the attached screenshot.

The relationship was being requested by an admin user, and the approval was from an account with the minimum permissions needed to request / approve relationships.

CommentFileSizeAuthor
Selection_001.png15.54 KBmrf
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mrf’s picture

Version: 6.x-1.0-rc5 » 6.x-1.x-dev
Issue tags: +6.x-1.1
mrf’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Issue tags: -6.x-1.1

Moving this to 7.x. I already did a workaround for this issue from when I noticed it, and I'd suspect its fixed in 7 already, but leaving this up as a reminder to double check.