When user send a relationship request to any user it displays status message "John has requested to be your Friend. View your pending friend requests to approve or decline" but when I delete the user John it diplays "Anonymous (not verified) has requested to be your Friend. View your pending friend requests to approve or decline". Why doesn't the request get deleted once the user who has requested is deleted?

Comments

D-pak’s picture

Project: User Relationships Manage » User Relationships
Version: » 7.x-1.0-alpha5
D-pak’s picture

Is there any one to suggest me solution for the same?

D-pak’s picture

Priority: Major » Critical
D-pak’s picture

Can I get the list of pending requests from the users who are deleted?

D-pak’s picture

Category: Bug report » Support request
D-pak’s picture

Who is maintaining the module?

sebto’s picture

Once a user has been deleted, UR module have to delete all relationships associated to deleted user but it doesn't work correctly. I implemented hook_user_delete in a custom module and delete non-approved relationships associated to the deleted user. like this:


/**
 * implements hook_user_delete
 */
function YOUR_MODULE_NAME_user_delete($account) {
  //user_relationships_delete_relationship($relationship, $user);
  db_delete('user_relationships')->condition('approved', 0 , '=')->condition(db_or()->condition('requester_id', $account->uid)->condition('requestee_id', $account->uid))->execute();
}

heylookalive’s picture

Title: It is displaying status message that Anonymous (not verified) has requested to be your Friend. View your pending friend requests to approve or decline. » User relationships aren't removed when a user is deleted (not cancelled)
Category: Support request » Bug report
Priority: Critical » Normal
Status: Active » Fixed

As @sebto said we're missing a hook which has now been implemented. Also demoting the priority as this isn't critical, @d-pak please give the following a read (though understand the frustration of no response):
https://www.drupal.org/node/45111

  • heylookalive committed ffc819f on 7.x-1.x
    Issue #2317871: It is displaying status message that Anonymous (not...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.