In activity2 the tokens are replaced before the message is written to the database. This leads to dead links if their href doesn't exist anymore, e.g. if the corresponding path alias is changed. I suggest to save the used tokens as well as their values to an extra field in the database table and replace them when the view is rendered. This way links always use the right path.

What do you think?

Comments

Scott Reynolds’s picture

Status: Active » Closed (works as designed)

This has been discussed to death. Replacing tokens when rendering them is slow, as you have to pull an serialized array out of the database and then unserialize it. Furthermore, the serialized array will not have a clue on what it needs to hold (ie does it need $node->nid, $node->title, $user->name), so then it would have to serialize and unserialize ALL OBJECTS used in the token replacement (in some cases that is 5 objects, and we all know that the node object gets rather large).

Unless you have a solution, marking as by design.