In Open Atrium 2 we have had a situation with backwards compatibility where a message_type text fragment is updated to use a new hardcoded token like @{message:user:name}. However, existing messages in the database were not saved with this new fragment, so they don't have the token. Thus, views like Recent Activity end up showing the new @{message:user:name} text in all of the older messages.

We desire a patch that replaces any un-resolved hardcoded tokens with normal "live" tokens. For example, replacing @{message:user:name} with [message:user:name] for older messages that didn't have the hardcoded token. While the data displayed for the old message is not necessarily correct, it's a better way to handle a bad situation than just removing the token or showing the @{...} text itself.

Patch forthcoming...

#3 message-token.jpg133.95 KBamitaibu
#1 message-token_replace-2046591-1.patch905 bytesmpotter
FAILED: [[SimpleTest]]: [MySQL] 68 pass(es), 1 fail(s), and 0 exception(s). View
Members fund testing for the Drupal project. Drupal Association Learn more


mpotter’s picture

Status: Active » Needs review
905 bytes
FAILED: [[SimpleTest]]: [MySQL] 68 pass(es), 1 fail(s), and 0 exception(s). View

Might be a better way to do this, but here is a patch to start with. Might want to add some options for controlling this at some point.

Status: Needs review » Needs work

The last submitted patch, message-token_replace-2046591-1.patch, failed testing.

amitaibu’s picture

133.95 KB
  • The current token handling should be changed to a select list, with another option -- replace hardcoded token with dynamic token
  • Add test <-- sorry about that, but we want to make sure it's always working properly ;)