0

I am using the Disable Messages module to disable one of the message which is being displayed to the end user. The message is:

Anonymous (not verified) has requested to be your Friend. View your pending friend requests to approve or decline.

To achieve this I have configured the module and written a regular expression to match a word from the message, But it seems to not be working.

Here is the code:

str.matches("(?i)(^|\\s+)(Anonymous (not verified))(\\s+|[.?!]$)");
  • 2
    It seems to be Off topic. This question is particularly related to forming rregular expression. It can be better answered in stackoverflow. – Mathankumar Aug 11 '14 at 7:48
  • This involves using the use of a regex in a specific Drupal module. I say this is on-topic here. – mpdonadio Aug 12 '14 at 22:27
  • yes @MDP, I had tried using the whole message to be hidden but too its not working. – D-pak Aug 13 '14 at 4:05
0

Once a user has been deleted, The User relationships 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();
}
| improve this answer | |

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.