Checkout page dies to an exception if \Magento\Paypal\Model\Info is extended with plugins. \Magento\Backup\Model\Backup affected as well. #9167
Labels
bug report
Component: Payment
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
The bug is a bit more general, than the immediate effects. The bug manifests in any class that contains a public method that returns by reference.
\Magento\Paypal\Model\Info
and\Magento\Backup\Model\Backup
are only such classes that I found in Magento CE 2.1.4.The bug would also manifest in any class with a public method what declares the return type. I didn't find any such classes in core Magento code.
The bug is caused by old version of Zend code generation that doesn't support the new features introduced in PHP 7. The generated interceptor lacks the correct return type, and that violates PHP rules. The exact class that does the generation is
vendor/zendframework/zend-code/src/Generator/MethodGenerator.php
. An updated version of the library that supports PHP 7 can be found here.A proper fix is to upgrade Zend code generator (or backport the changes), but a workaround is to skip affected functions:
Preconditions
Reproduced on Magento CE 2.1.4. Other versions probably affected as well.
Steps to reproduce
Expected result
Checkout page should be shown.
Actual result
The text was updated successfully, but these errors were encountered: