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

Error after upgrade: Uncaught Error: Class 'Pelago\Emogrifier\CssInliner' #2925

Closed
djixas opened this issue Jan 12, 2023 · 12 comments
Closed

Comments

@djixas
Copy link

djixas commented Jan 12, 2023

Preconditions (*)

  1. Upgraded from Magento 1.9.4 to MageLTS 19.4.21
  2. The issue appears in PHP 7.4 and PHP 8.0

Steps to reproduce (*)

  1. Upgrade Magento and try to reset admin password
  2. The following error will be shown

Expected result (*)

  1. It should reset password

Actual result (*)

  1. It throws error, and every email since then is just HTML code instead of "HTML code converted to data"
Fatal error:  Uncaught Error: Class 'Pelago\Emogrifier\CssInliner' not found in /home/xxxxxxxxxx/public_html/app/code/core/Mage/Core/Model/Email/Template/Abstract.php:200
Stack trace:
#0 /home/xxxxxxxxxx/public_html/app/code/core/Mage/Core/Model/Email/Template.php(354): Mage_Core_Model_Email_Template_Abstract->_applyInlineCss('\n\n\n\n\n\n<!DOCTYPE...')
#1 /home/xxxxxxxxxx/public_html/app/code/core/Mage/Core/Model/Email/Template.php(328): Mage_Core_Model_Email_Template->getPreparedTemplateText('\n\n\n\n\n\n<!DOCTYPE...')
#2 /home/xxxxxxxxxx/public_html/app/code/core/Mage/Core/Model/Email/Template.php(402): Mage_Core_Model_Email_Template->getProcessedTemplate(Array, true)
#3 /home/xxxxxxxxxx/public_html/app/code/core/Mage/Core/Model/Email/Template.php(518): Mage_Core_Model_Email_Template->send('MYEMAIL@GMAIL...', Array, Array)
#4 /home/xxxxxxxxxx/public_html/app/code/core/Mage/Core/Model/Email/Template/Mailer.php(78): Mage_Core_Model_Email_Template->sendTransactional('admin_emails_fo...', 'general', Array, Array, Array, 0)
#5 /home/xxxxxxxxxx in /home/xxxxxxxxxx/public_html/app/code/core/Mage/Core/Model/Email/Template/Abstract.php on line 200

Line 200 - $emogrifier = \Pelago\Emogrifier\CssInliner::fromHtml($html)

@djixas djixas added the bug label Jan 12, 2023
@ADDISON74 ADDISON74 removed the bug label Jan 12, 2023
@ADDISON74
Copy link
Contributor

The repository no longer has the /lib/Pelago directory, but the release version contains it. Download the archive and put it there or use Composer. You face this issue because you used the git command and what you had local was synchronized with remote.

@ADDISON74
Copy link
Contributor

Here you go https://github.com/OpenMage/magento-lts/releases/tag/v19.4.21

@fballiano
Copy link
Contributor

how did you upgrade? git a git pull from a development branch? IMHO don't use development branches, use a release tag, better if with composer.

anyway composer install will fix that error

@djixas
Copy link
Author

djixas commented Jan 12, 2023

Here you go https://github.com/OpenMage/magento-lts/releases/tag/v19.4.21

Thank you very much, the error is now gone, but I still see HTML code instead of real email, for all emails since upgrade.

how did you upgrade? git a git pull from a development branch? IMHO don't use development branches, use a release tag, better if with composer.

anyway composer install will fix that error

I've upgraded via "as it turns out, outdated" automatic script by OpenMage team, now reuploaded files from https://github.com/OpenMage/magento-lts/releases/tag/v19.4.21

@fballiano
Copy link
Contributor

mmm i've never seen that script, i'll look for it, maybe it broke because our development branches are very different from the released ones.

@djixas
Copy link
Author

djixas commented Jan 12, 2023

mmm i've never seen that script, i'll look for it, maybe it broke because our development branches are very different from the released ones.

Yes, they've since decided to drop it OpenMage/migrate#6

But the issue was there with HTML emails right after upgrade, then same with dev branch and .ZIP

Anyhow, I'll probably create another ticket for HTML issue, thank you for your help

@fballiano
Copy link
Contributor

ah, weird I'm not subscribed to that repo, BTW it seems very outdated, I wouldn't use it

@fballiano
Copy link
Contributor

@ADDISON74 @djixas I've created this PR to discontinue the migration script, vote for it if you feel it's correct ;-)

OpenMage/migrate#7

@djixas
Copy link
Author

djixas commented Jan 12, 2023

ah, weird I'm not subscribed to that repo, BTW it seems very outdated, I wouldn't use it

Yeah, sadly, this is how "they got me", as it was the top recommendation at https://www.openmage.org/magento-lts/migration-guide.html

@ADDISON74 @djixas I've created this PR to discontinue the migration script, vote for it if you feel it's correct ;-)

OpenMage/migrate#7

I'm fairly new to Github, sorry, do I just +1 with comment or?

@fballiano
Copy link
Contributor

can I ask you where is that page linked? cause I can't find a link to it.

that page, to me, should be complete redone, i woulnd't use (and i didn't when i migrated my shops) any of those methods.

@fballiano
Copy link
Contributor

I'm fairly new to Github, sorry, do I just +1 with comment or?

that's enough at the moment :-)

@colinmollenhour
Copy link
Member

@fballiano Can you describe the method you used to migrate, perhaps in a form that we can put on the website or in a README?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants