Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-14443

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




      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:


      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




            Marc Marc
            gn#36 gn#36 [X] (Inactive)
            0 Vote for this issue
            1 Start watching this issue