Here is simple patch for additional tokens: ['requestor-uid'], ['requestee-uid'], ['requestor-url'], ['requestee-url']

Comments

mrjavum’s picture

StatusFileSize
new1.14 KB

The fixed patch with base_path() in URL

sirkitree’s picture

Status: Needs review » Fixed

committed. thanks!

Scott Reynolds’s picture

Status: Fixed » Needs review
StatusFileSize
new883 bytes

eeek! no need for base_path()

See attached patch to fix.

mrjavum’s picture

But if I need to transfer site for another domen? The messages with absolute paths will be wrong...

sirkitree’s picture

@mrjavum - actually, if you look at the api docs (http://api.drupal.org/api/function/url/6) you will see that the change Scott made does exactly the same thing by using the last argument options of absolute = true.

Please apply the patch and test it out and let me know if it really doesn't work for you.

mrjavum’s picture

Yes, I read about url function.
But by analogy with token module (token_user.inc)

$values['account-url']    = $account->uid ? url("user/$account->uid") : '';

the relative path is better then absolute path (with http://www.example.com in path)

Scott Reynolds’s picture

But if I need to transfer site for another domen? The messages with absolute paths will be wrong...

nope, they will be fine.

mrjavum’s picture

F.e. my site is on www.site1.com and all recorded messages contains links like this http://www.site1.com/user/1
I decided to transfer it to www.site2.com and all recorded messages with www.site1.com in path will be incorrect, or I'm not right?

Scott Reynolds’s picture

In the case of activity module, yes. But then your patch would have the same problem. Perhaps @sirkitree, these should be relative paths. Absolute paths only useful for things like email.

edit: this is only the case for Activity2. Any other way these tokens are used will be fine. Even transfering from one site to another.

sirkitree’s picture

Status: Needs review » Needs work

Yes, I'm thinking they need to be relative. That way when you do change sites the links will still work.

sirkitree’s picture

Status: Needs work » Fixed

This was implemented.

Status: Fixed » Closed (fixed)

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