Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-12436

Use the mail class reference from the same wiki as the mail template document when evaluating a mail template

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.1.4
    • Fix Version/s: 7.2-milestone-3
    • Component/s: Mail
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      If using a mail template from a different wiki, the current wiki's mail class will be resolved when fetching the XWiki.Mail object from the template document.

      This fails to find the object and a NPE is thrown:

      java.lang.NullPointerException: null
              at org.xwiki.mail.internal.factory.template.DefaultMailTemplateManager.getMailObjectsCount(DefaultMailTemplateManager.java:154) ~[xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na]
              at org.xwiki.mail.internal.factory.template.DefaultMailTemplateManager.getObjectMailNumber(DefaultMailTemplateManager.java:126) ~[xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na]
              at org.xwiki.mail.internal.factory.template.DefaultMailTemplateManager.evaluate(DefaultMailTemplateManager.java:93) ~[xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na]
              at org.xwiki.mail.internal.factory.template.AbstractTemplateMimeMessageFactory.createMessage(AbstractTemplateMimeMessageFactory.java:96) ~[xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na]
              at org.xwiki.mail.internal.factory.template.AbstractTemplateMimeMessageFactory.createMessage(AbstractTemplateMimeMessageFactory.java:47) ~[xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na]
              at org.xwiki.watchlist.internal.notification.WatchListEventMimeMessageIterator.next(WatchListEventMimeMessageIterator.java:141) ~[xwiki-platform-watchlist-api-7.2-SNAPSHOT.jar:na]
              at org.xwiki.watchlist.internal.notification.WatchListEventMimeMessageIterator.next(WatchListEventMimeMessageIterator.java:52) ~[xwiki-platform-watchlist-api-7.2-SNAPSHOT.jar:na]
              at org.apache.commons.collections4.iterators.IteratorIterable$1.next(IteratorIterable.java:77) ~[commons-collections4-4.0.jar:4.0]
              at org.xwiki.mail.internal.thread.PrepareMailRunnable.prepareMail(PrepareMailRunnable.java:118) [xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na]
              at org.xwiki.mail.internal.thread.PrepareMailRunnable.run(PrepareMailRunnable.java:74) [xwiki-platform-mail-send-default-7.2-SNAPSHOT.jar:na]
              at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]
      

        Attachments

          Activity

            People

            • Assignee:
              enygma Eduard Moraru
              Reporter:
              enygma Eduard Moraru
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: