Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pelago/emogrifier and friendsofphp/php-cs-fixer updated #31772

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/code/Magento/Email/Model/Template/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,8 @@ public function applyInlineCss($html)
try {
// Don't try to compile CSS that has compilation errors
if (strpos($cssToInline, ContentProcessorInterface::ERROR_MESSAGE_PREFIX)
!== false ||
strpos($cssToInline, 'undefined')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sivaschenko .. I have added this commit to fix the integration test for

'Developer mode - File with compilation error results in error message' => [

Can you please review this? I feel we need to handle this in different way
Thanks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@konarshankar07 Looks like emogrifier is no longer actually working with CSS string containing the error message.

I think the best way to handle the CSS parsing error is to throw an exception in \Magento\Email\Model\Template\Filter::getCssFilesContent and handle it in client code.
Instead of returning an exception message as the result css and then parsing the result for error messages.

Thank you!

!== false
) {
throw new MailException(
Expand Down