DragonByte Tech
Well-known member
- Affected version
- 2.1.3
Code:
Server error log
Error: Call to a member function appendChild() on null src/vendor/pelago/emogrifier/src/Emogrifier.php:1419
Generated by: Unknown account Jul 26, 2019 at 12:01 AM
Stack trace
#0 src/vendor/pelago/emogrifier/src/Emogrifier.php(1328): Pelago\Emogrifier->addStyleElementToDocument('.listInline.lis...')
#1 src/vendor/pelago/emogrifier/src/Emogrifier.php(526): Pelago\Emogrifier->copyUninlineableCssToStyleNode(Object(DOMXPath), Array)
#2 src/vendor/pelago/emogrifier/src/Emogrifier.php(377): Pelago\Emogrifier->process()
#3 src/XF/Mail/Styler.php(36): Pelago\Emogrifier->emogrify()
#4 src/XF/Mail/Mailer.php(187): XF\Mail\Styler->styleHtml('<p>The Northwes...', false, Object(XF\Language))
#5 src/addons/DBTech/Mail/Job/DigestEmail.php(169): XF\Mail\Mailer->renderMailTemplate('dbtech_mail_dig...', Array, Object(XF\Language), Object(SV\ElasticSearchEssentials\XF\Entity\User))
#6 src/XF/Job/AbstractUserCriteriaJob.php(59): DBTech\Mail\Job\DigestEmail->executeAction(Object(SV\ElasticSearchEssentials\XF\Entity\User))
#7 src/addons/DBTech/Mail/Job/DigestEmail.php(77): XF\Job\AbstractUserCriteriaJob->run(G)
#8 src/XF/Job/Manager.php(253): DBTech\Mail\Job\DigestEmail->run(G)
#9 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#10 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#11 job.php(42): XF\Job\Manager->runQueue(false, 8)
#12 {main}
DBTech\Mail\Job\DigestEmail
is an extension to XF\Job\UserEmail
.This is the relevant block of code from that class:
PHP:
$renderedMail = $this->app->mailer()->renderMailTemplate(
'dbtech_mail_digest', [
'digest' => $digest,
'content' => $content,
'user' => $user,
'brandingVariables' => $this->data['brandingVariables']
], $language, $user);
This is the contents of the template
email:dbtech_mail_digest
:
HTML:
<mail:subject>{$digest.title}</mail:subject>
<xf:if is="$digest.introduction"><p>{$digest.introduction|raw}</p></xf:if>
<xf:if is="$content is not empty">
<xf:foreach loop="$content" key="$contentType" value="$contentTypeContent">
{$contentTypeContent|raw}
<hr />
</xf:foreach>
<xf:else />
<p>{{ phrase('dbtech_mail_digest_no_content') }}</p>
</xf:if>
<xf:if is="{$user.dbtech_mail_newsletter_frequency} > 1">
{{ phrase('dbtech_mail_newsletter_reducefrequency_further_link', {
'param1': '<a href="' . link('canonical:dbtech-mail/digests/reduce-frequency', $digest, {'c': $user.email_confirm_key, 'user_id': $user.user_id}) . '">' . phrase('dbtech_mail_click_here') . '</a>'
}) }}
{{ phrase('dbtech_mail_newsletter_increasefrequency_link', {
'param1': '<a href="' . link('canonical:dbtech-mail/digests/increase-frequency', $digest, {'c': $user.email_confirm_key, 'user_id': $user.user_id}) . '">' . phrase('dbtech_mail_click_here') . '</a>'
}) }}
<xf:else />
{{ phrase('dbtech_mail_newsletter_reducefrequency_link', {
'param1': '<a href="' . link('canonical:dbtech-mail/digests/reduce-frequency', $digest, {'c': $user.email_confirm_key, 'user_id': $user.user_id}) . '">' . phrase('dbtech_mail_click_here') . '</a>'
}) }}
</xf:if>
<p class="minorText"><a href="{{ link('canonical:dbtech-mail/digests/settings', $digest) }}">{{ phrase('dbtech_mail_configure_digest_content_settings') }}</a></p>
<p class="minorText"><a href="{{ link('canonical:email-stop/content', $user, {'t': 'dbtech_mail_digest', 'id': $digest.digest_id}) }}">{{ phrase('dbtech_mail_newsletter_unsubscribe_link') }}</a></p>
<xf:if is="$brandingVariables">
<p class="footer p-footer-copyright">{$brandingVariables.flavour}
<a rel="nofollow noopener" href="https://www.dragonbyte-tech.com/store/{$brandingVariables.productid}/?utm_source={$brandingVariables.utm_source}&utm_campaign=product&utm_medium={$brandingVariables.utm_medium}&utm_content={$brandingVariables.utm_content}" target="_blank">{$brandingVariables.title}</a>.
<br />
<a rel="nofollow noopener" href="https://www.dragonbyte-tech.com/?utm_source={$brandingVariables.utm_source|raw}&utm_campaign=site&utm_medium={$brandingVariables.utm_medium}&utm_content={$brandingVariables.utm_content}" target="_blank">Copyright © {$brandingVariables.date} DragonByte Technologies Ltd.</a>
</p>
</xf:if>
<xf:page option="template"></xf:page>
<xf:if is="$digest.introduction"><p>{$digest.introduction|raw}</p></xf:if>
is the bit that causes #4 in the stack trace above.Users have tested both using HTML in the digest introduction, and using plaintext, both still cause the error. Removing the introduction text itself appears to fix it.
Please let me know if you require any further information.