I was trying to customize my email templates to include a node title after the task name and could not figure out why it was not displaying my override. After bashing my head in a few times I figured out that it was actually displaying the workflow name instead of the task name. Apparently order is very important to str_replace and the hashes are useless. str_replace will replace the first element of the search array with the first element of the replace array and so forth. To fix this on line 108ish of maestro_notification.class.php change:

    $tokens = array('task_console_url' => '[task_console_url]', 'workflow_name' => '[workflow_name]', 'task_name' => '[task_name]', 'task_owner' => '[task_owner]');

to

    $tokens = array('task_console_url' => '[task_console_url]', 'task_name' => '[task_name]', 'workflow_name' => '[workflow_name]', 'task_owner' => '[task_owner]');

Comments

kevin.klika’s picture

Priority: Normal » Major
Issue summary: View changes

This is unbelievable! I ran into the same issue, and this person provided the exact resolution to the problem. I have confirmed this bug fix... Why has this not been rolled in yet? Two years old... I'm not using Git for my site otherwise I would post a diff...
:(

haydeniv’s picture

Status: Active » Needs review
StatusFileSize
new864 bytes

Can't believe it has been this long. I've stopped using Maestro since then but for good measure here is a patch. :)

blainelang’s picture

This was clearly the case of us just loosing track of this issue and solution and not us being lazy, so please go easy on the condemnation. We are all trying to contribute our time here and you can see by the commit history for this project that it's far from being ignored.

The patch has now been committed.

Thanks for your report and patch.

blainelang’s picture

Status: Needs review » Fixed
haydeniv’s picture

Just for clarification my comments were in reference to that I had long forgotten about this issue, not trying to be snarky. :) Thanks for the great work!

Status: Fixed » Closed (fixed)

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

  • Commit e2ca7db on master, 8.x-1.x authored by haydeniv, committed by blainelang:
    Fix for token order replacement issue in email notification #1387362