amzn / amazon-payments-magento-2-plugin

Extension to enable Amazon Pay on Magento 2
https://amzn.github.io/amazon-payments-magento-2-plugin/
Apache License 2.0
108 stars 76 forks source link

Error: Class 'Magento\Framework\Validator\ValidatorChain' not found #1184

Closed tim-breitenstein-it closed 1 year ago

tim-breitenstein-it commented 1 year ago

What I expected

No CRITICAL Error

What happened instead

system.log:

[2023-04-20 05:37:51] main.CRITICAL: Error: Class 'Magento\Framework\Validator\ValidatorChain' not found in /var/www/share/magento/htdocs/vendor/amzn/amazon-pay-magento-2-module/Helper/Customer.php:82
Stack trace:
#0 /var/www/share/magento/htdocs/vendor/amzn/amazon-pay-magento-2-module/Controller/Login.php(235): Amazon\Pay\Helper\Customer->createCustomer(Object(Amazon\Pay\Domain\AmazonCustomer))
#1 /var/www/share/magento/htdocs/vendor/amzn/amazon-pay-magento-2-module/Controller/Login.php(219): Amazon\Pay\Controller\Login->createCustomer(Object(Amazon\Pay\Domain\AmazonCustomer))
#2 /var/www/share/magento/htdocs/vendor/amzn/amazon-pay-magento-2-module/Controller/Login/Checkout.php(57): Amazon\Pay\Controller\Login->processAmazonCustomer(Object(Amazon\Pay\Domain\AmazonCustomer))
#3 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(58): Amazon\Pay\Controller\Login\Checkout->execute()
#4 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(138): Amazon\Pay\Controller\Login\Checkout\Interceptor->___callParent('execute', Array)
#5 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(153): Amazon\Pay\Controller\Login\Checkout\Interceptor->Magento\Framework\Interception\{closure}()
#6 /var/www/share/magento/htdocs/generated/code/Amazon/Pay/Controller/Login/Checkout/Interceptor.php(23): Amazon\Pay\Controller\Login\Checkout\Interceptor->___callPlugins('execute', Array, Array)
#7 /var/www/share/magento/htdocs/vendor/magento/framework/App/Action/Action.php(111): Amazon\Pay\Controller\Login\Checkout\Interceptor->execute()
#8 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#9 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(138): Amazon\Pay\Controller\Login\Checkout\Interceptor->___callParent('dispatch', Array)
#10 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(153): Amazon\Pay\Controller\Login\Checkout\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#11 /var/www/share/magento/htdocs/generated/code/Amazon/Pay/Controller/Login/Checkout/Interceptor.php(32): Amazon\Pay\Controller\Login\Checkout\Interceptor->___callPlugins('dispatch', Array, Array)
#12 /var/www/share/magento/htdocs/vendor/magento/framework/App/FrontController.php(245): Amazon\Pay\Controller\Login\Checkout\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#13 /var/www/share/magento/htdocs/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse(Object(Amazon\Pay\Controller\Login\Checkout\Interceptor), Object(Magento\Framework\App\Request\Http))
#14 /var/www/share/magento/htdocs/vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest(Object(Magento\Framework\App\Request\Http), Object(Amazon\Pay\Controller\Login\Checkout\Interceptor))
#15 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#16 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#17 /var/www/share/magento/htdocs/vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php(99): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#18 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#19 /var/www/share/magento/htdocs/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(71): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#20 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#21 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\PageCache\Model\App\FrontController\BuiltinPlugin\Interceptor->___callParent('aroundDispatch', Array)
#22 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\PageCache\Model\App\FrontController\BuiltinPlugin\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#23 /var/www/share/magento/htdocs/generated/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin/Interceptor.php(23): Magento\PageCache\Model\App\FrontController\BuiltinPlugin\Interceptor->___callPlugins('aroundDispatch', Array, Array)
#24 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin\Interceptor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#25 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#26 /var/www/share/magento/htdocs/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)
#27 /var/www/share/magento/htdocs/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#28 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Http->launch()
#29 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\Http\Interceptor->___callParent('launch', Array)
#30 /var/www/share/magento/htdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
#31 /var/www/share/magento/htdocs/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http\Interceptor->___callPlugins('launch', Array, Array)
#32 /var/www/share/magento/htdocs/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#33 /var/www/share/magento/htdocs/pub/index.php(29): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#34 {main} [] null

Steps to reproduce the issue

Working Productive Magento 2 Instance with Amazon Pay for Magento 2 installed and configured.

Class: Magento\Framework\Validator\ValidatorChain only exists since Magento v2.4.6

https://github.com/magento/magento2/blob/2.4.6/lib/internal/Magento/Framework/Validator/ValidatorChain.php => OK

https://github.com/magento/magento2/blob/2.4.5-p2/lib/internal/Magento/Framework/Validator/ValidatorChain.php => 404 - page not found

Your setup

sgabhart22 commented 1 year ago

Hi @tim-breitenstein-it ,

Thank you for raising the issue. Until a new version is released fixing backward compatibility, you can apply the patch attached here to restore functionality.

gh-1184.patch.txt

Thanks again, Spencer

sgabhart22 commented 1 year ago

Hello again @tim-breitenstein-it ,

This has been addressed in version 5.15.0 of the AP module, now available on the Magento Marketplace. We will be closing this issue shortly. Thanks again for the callout!

Spencer