简体   繁体   中英

Magento 2 Error: Return value of Magento\Framework\Filter\DirectiveProcessor\TemplateDirective::process() must be of the type string, null returned

I'm having this error when a successful order is processed in my Magento 2 website.

Fatal error: Uncaught TypeError: Return value of Magento\Framework\Filter\DirectiveProcessor\TemplateDirective::process() must be of the type string, null returned

I've read in another post that it must be a variable in the email template that is causing this. So I went and removed all content from email templates and left it with a simple HTML with no variables....the issue persists.

The order is successfully saved and everything. But this issue appears when you process the order from SagePay and when it redirects you to your website.

Any ideas?

Something in the email template is not String, so casting the string within the email template filter method to ensure the return value is a string should help.

  1. Install module

template_error.zip

  1. Switch to Production mode.
  2. Go to Marketing -> Newsletter Templates and create a new one.
  3. Insert {{template config_path="design/email/header_template"}} into Template Content filed.
  4. Preview Template.

Check the fix here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM