Skip to content

[Issue] Ensure string is returned when applying filter to email template #32671

Closed
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #32298: Ensure string is returned when applying filter to email template


Description (*)

Added string casting within the email template filter method to ensure the return value is a string.
Currently if an exception is caught while not in developer mode a Phrase object is returned. This in turn triggers a fatal Uncaught TypeError in magento/framework/Filter/DirectiveProcessor/TemplateDirective.php:68.

Related Pull Requests

N/A

Fixed Issues (if relevant)

N/A

Manual testing scenarios (*)

  1. Install module
    template_error.zip
  2. Switch to Production mode.
  3. Go to Marketing -> Newsletter Templates and create a new one.
  4. Insert {{template config_path="design/email/header_template"}} into Template Content filed.
  5. Preview Template.
  6. We're sorry, an error has occurred while generating this content. message displayed.

Questions or comments

N/A

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

Labels

Component: EmailFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions