When you send a relationship request and the User Relationship PrivateMsg module is enabled, the private message which is sent to the requestee has the title "[[requester]] believes they are a of yours". The title should be "[[requester]] believes they are a [[relationship type]] of yours"

I've tracked this down to the function user_relationships_request_relationship in user_relationships_api.inc where the $relationship object is built before being handed over to the other modules for additional processing. The object build is currently

  $relationship = (object)array(
    'requester_id'  => $requester->uid,
    'requestee_id'  => $requestee->uid,
    'approved'      => ($approved ? 1 : 0),
    'rtid'          => $type->rtid,
  );

but I think it should be

  $relationship = (object)array(
    'requester_id'  => $requester->uid,
    'requestee_id'  => $requestee->uid,
    'approved'      => ($approved ? 1 : 0),
    'rtid'          => $type->rtid,
    'name'          => $type->name,
    'plural_name'   => $type->plural_name,
  );

I've patched my installation with this, and it seems to test out OK. However, could someone who understands User Relationships a bit better please review this before submission.

CommentFileSizeAuthor
#1 userrelationships-271247-1.patch579 bytesMark B

Comments

Mark B’s picture

StatusFileSize
new579 bytes

Adding patch file - it's my first Drupal patch, so please be patient if I've done this all wrong!

reed.richards’s picture

I can confirm that this works! Good work!

jaydub’s picture

Version: 5.x-2.8 » 5.x-2.x-dev
alex.k’s picture

Status: Needs review » Postponed (maintainer needs more info)

Just tried this use case, and it worked correctly without the patch. Something could be different about our setups. Could you try the current 5.x-2.x-dev release and re-test? Thanks.

berdir’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Sorry for pinging the participants.

Now that Drupal 7 is out, there is no support for Drupal 5 and the corresponding modules anymore. Therefore, I'm closing all old issues which are still open.

I suggest you upgrade to Drupal 6 or 7 and figure out if you're feature is still needed or the bug still exists and open a new issue in that case.