sdinteractive / Magento2_SomethingDigital_UpgradeHelper

18 stars 23 forks source link

Remove setting area code on Email Template Checker #48

Closed chapagain closed 3 months ago

chapagain commented 3 months ago

While running upgrade-helper command:

bin/magento sd:dev:upgrade-helper magento-2-4-5-p8-ee--2-4-5-p9-ee.diff

I got the following error:

[2024-08-20T18:54:24.989439+00:00] main.ERROR: Area code is already set
#0 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\State->setAreaCode('frontend')
#1 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\State\Interceptor->___callParent('setAreaCode', Array)
#2 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\State\Interceptor->Magento\Framework\Interception\{closure}('frontend')
#3 /var/www/html/generated/code/Magento/Framework/App/State/Interceptor.php(41): Magento\Framework\App\State\Interceptor->___callPlugins('setAreaCode', Array, Array)
#4 /var/www/html/app/code/SomethingDigital/UpgradeHelper/Model/Checker/EmailTemplate.php(34): Magento\Framework\App\State\Interceptor->setAreaCode('frontend')
#5 /var/www/html/app/code/SomethingDigital/UpgradeHelper/Model/Checker/EmailTemplate.php(51): SomethingDigital\UpgradeHelper\Model\Checker\EmailTemplate->mapEmailTemplates()
#6 /var/www/html/app/code/SomethingDigital/UpgradeHelper/Model/Runner.php(53): SomethingDigital\UpgradeHelper\Model\Checker\EmailTemplate->check(Array)
#7 /var/www/html/app/code/SomethingDigital/UpgradeHelper/Console/UpgradeHelperCommand.php(57): SomethingDigital\UpgradeHelper\Model\Runner->run('diff --color -r...')
#8 /var/www/html/vendor/symfony/console/Command/Command.php(255): SomethingDigital\UpgradeHelper\Console\UpgradeHelperCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): SomethingDigital\UpgradeHelper\Console\UpgradeHelperCommand\Interceptor->___callParent('run', Array)
#11 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): SomethingDigital\UpgradeHelper\Console\UpgradeHelperCommand\Interceptor->Magento\Framework\Interception\{closure}(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/html/generated/code/SomethingDigital/UpgradeHelper/Console/UpgradeHelperCommand/Interceptor.php(77): SomethingDigital\UpgradeHelper\Console\UpgradeHelperCommand\Interceptor->___callPlugins('run', Array, Array)
#13 /var/www/html/vendor/symfony/console/Application.php(1021): SomethingDigital\UpgradeHelper\Console\UpgradeHelperCommand\Interceptor->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand(Object(SomethingDigital\UpgradeHelper\Console\UpgradeHelperCommand\Interceptor), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/vendor/magento/framework/Console/Cli.php(116): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/bin/magento(23): Symfony\Component\Console\Application->run()
#18 {main} [] []

This PR removes the setting of area code in the Email Template Checker class.

mpchadwick commented 3 months ago

According to this issue, "this results in email template analysis being skipped"

https://github.com/sdinteractive/Magento2_SomethingDigital_UpgradeHelper/issues/42

Not sure what to make of that comment. Do the tests here (https://github.com/sdinteractive/Magento2_SomethingDigital_UpgradeHelper/pull/41/files#diff-6d548b10ab9bee04d4638c0ae0e465fd7ab30677328d599622fad77415429fb7) still pass?

chapagain commented 3 months ago

@mpchadwick The tests passed.

Screenshot 2024-08-20 at 4 33 13 PM