I am using User Relationships module. Its working fine. But I want to change a default message which get displayed on user site after getting request.

The message is like

"John has requested to be your Friend. View your pending relationship requests to approve or decline."

I want same message to be displayed as

"John has requested to be your Friend. View your pending friend requests to approve or decline."

Just want to replace the word relationship with friend. How can I do that?

  • try disable messages module to disable the message and rules to add a message on an event that you specify in the ui.
    – SDMulroy
    Jul 3 '14 at 5:39

User Relationship module allows you to set your own message, you can override the default message by settting a variable using variable_set("user_relationships_msg_{$key}", "Custom Message"), check the functions user_relationships_get_message() and _user_relationships_default_messages().

  • I have tried this. But it is replacing all the site wide words. For an instance Relationship word in view's edit page. Since the above message is having link in it, we cant change the whole sentence using String overrides module.
    – D-pak
    Jul 3 '14 at 5:49
  • @D-pak Updated the answer
    – wolverine
    Jul 3 '14 at 6:16
  • Ok wolverine I will do that, but what if my module gets updated. Will the changes remain same? or will all changed get back to the default again?
    – D-pak
    Jul 3 '14 at 6:21
  • Implement hook_enable() in your module install file and set the variables, similarly in hook_disable() delete the variables. In that way the changes will be there as long as your module is enabled.
    – wolverine
    Jul 3 '14 at 6:25

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.