Uploaded image for project: 'COmanage'
  1. COmanage
  2. CO-2076

Existing Message Templates Throws Error on Notifications

    XMLWordPrintable

Details

    Description

      Message Templates that existed prior to 4.0.0 do not have a format set. When trying to send a Notification, CoPetition throws an error:

      Call to a member function to() on string

      Error: An Internal Error Has Occurred.

      Stack Trace

      APP/Model/CoNotification.php line 759 → CoNotification->sendEmail(string, string, string, string, string, string, string, string, string, boolean, string, string, null)

      This is because CoMessageTemplate::getMessageTemplateFields() sets $format to $tmpl['format'], regardless of whether or not there is a value there (and overriding the default value set two lines above). $format should only be overwritten if $tmpl['format'] is not empty.

      Additionally, there should probably be some code added to UpgradeVersionShell::post400() that populates cm_co_message_templates:format to MessageFormatEnum::Plaintext for all existing message templates.

      Attachments

        Issue Links

          Activity

            People

              ioannis.igoumenos@at.internet2.edu Ioannis Eythymios Igoumenos
              benn.oshrin@at.internet2.edu Benn Oshrin (internet2.edu)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: