0

I rigged up a test of sendEmailTemplate by putting this in a transition:

        <actions>
        <!--
    <service-call name="org.moqui.impl.UserServices.reset#Password"/>
    -->
    <service-call name="org.moqui.impl.EmailServices.send#EmailTemplate">
            <field-map field-name="emailTemplateId" value="PASSWORD_RESET"/>
            <field-map field-name="toAddresses" value="test@gmail.com"/>
            <field-map field-name="bodyParameters" from="[userAccount:userAccount, newPassword: 'xxxxxxx']"/>
    </service-call>

...

and I end up with this error: java.lang.NullPointerException: Cannot execute null+null at org.codehaus.groovy.runtime.NullObject.plus(NullObject.java:121) ... at org.moqui.impl.context.WebFacadeImpl.getWebappRootUrl(WebFacadeImpl.groovy:272)

because both webappName and servletContextPath are null.

This comes from the text render in sendEmailTemplate (ln 77) so webappName is not set as it is in the call right above.

But all of this misses the point - I think. I think the error is in ScreenUrlInfo (~ln 450):

if (sri.baseLinkUrl) {
        baseUrl = sri.baseLinkUrl
        if (baseUrl && baseUrl.charAt(baseUrl.length()-1) == '/') baseUrl.substring(0, baseUrl.length()-1)
    } else {
        baseUrl = WebFacadeImpl.getWebappRootUrl(sri.webappName, sri.servletContextPath, true,
                this.requireEncryption, (ExecutionContextImpl) ec)
    }

sri.baseLinkUrl is not set and I think that is the problem. Where should sri.baseLinkUrl be being set?

Al Byers
  • 53
  • 3
  • This looks like more of a bug report than a question (i.e. how-to, what-is, etc... there is a good definition of questions here on StackOverflow). The best place for bug reports is the GitHub moqui issues at: https://github.com/jonesde/moqui/issues – David E. Jones Mar 10 '14 at 10:54
  • Quick follow-up: this was caused by the sendEmailTemplate.groovy script not passing in a webappName. It is fixed in git commit #046bea5. – David E. Jones Mar 11 '14 at 00:53

0 Answers0