Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-19758

$messageTokens has two formats in use

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Incomplete
    • Affects Version/s: 4.7
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      Developer Doc
    • Funding Source:
      Contributed Code
    • Verified?:
      No

      Description

      Identified this while debugging CRM-19757, but having pursued the suggestion of an additional method to reformat the passed $messageTokens array, I found that it did not address the issue at hand there.

      May relate to: CRM-18713, CRM-19757.

      Here's an addition to TokenCompatSubscriber which reformats $messageTokens into the CiviMail-style format. IMO the numerically keyed array format is superior, but I wrote this to see if the reformat would fix an issue affecting scheduled actions. It didn't, so this is not a PR.

      I identified this behaviour while debugging token support in scheduled reminders (action_schedule). I found that testing CiviMail and ActionSchedule one after the other, a different $messageTokens value was passed into TokenCompatSubscriber::onEvaluate()

      Coming from CiviMail:

          [ 'contact' => [ 'first_name' => 1, 'email_greeting' => 1 ] ] ]
      

      Coming from ActionSchedule:

          [ 'contact' => [ 'checksum', 'contact_id' ] ]
      

        Attachments

          Activity

            People

            • Assignee:
              xurizaemon Chris Burgess
              Reporter:
              xurizaemon Chris Burgess
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: