Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-14443

jabber notification-template prefix "short" breaks resolution of paths in extensions

    Details

      Description

      When jabber is enabled in a board, it can also be used for notifications created by extensions. For all Notifications that provide an email template, a user can also choose jabber for delivery. However, the creation of the message fails with:

      Error

      [Twig_Error_Loader]
      Unable to find template "short/@gn36_versionchecknotifier/mail_ext_update.txt" (looked into: ..../phpBB/bin/../language/de/email).

      I have tested with different extensions as well, the error stays the same, regardless of whether a file language/de/email/short/mail_ext_update.txt is present or not (obviously, substitute mail_ext_update.txt by any other file that might be used by an extension).

      In phpbb/notification/method/jabber.php, a prefix is defined for the templates, which is normally used to have shorter texts for the messages that are sent out:

      return $this->notify_using_messenger(NOTIFY_IM, 'short/');
      

      Apparently, the extension information must be at the start of the template path and therefore Twig cannot find the jabber template.

      I have tested this on the console by running a cronjob that creates a notification, but creating a different notification from a different extension using a regular browser results in the same problem. Sending out emails with the same notification works without issues.

      I see multiple problems here:
      1. There may not be a special jabber template for each case, the notification provides an email template, but there is no fallback on a regular email template.
      2. Apparently, the prefix "short/" completely breaks path resolution to find the email templates in the extensions.

      Steps to reproduce:

      • Install an extension that creates a notification and provides an email template for it
      • activate jabber on your test board
      • Enable Jabber for the notification created by that extension
      • trigger the creation of the notification

        Attachments

          Activity

            People

            • Assignee:
              Marc Marc
              Reporter:
              gn#36 gn#36
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: