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
$block->getProduct() in catalog product view template failed after upgrading from 2.3.0 to 2.3.1 #22036
Comments
The PR#22034 request has been approved, but I'm not sure how to update the status of this bug. |
✅ Confirmed by @shikhamis11 Issue Available: @shikhamis11, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
Hello, same issue to me too. But i think that the error is at
|
Hi @panteliskopsias , if the $_product returned from Line 17 is NULL, then the null object reference error would be reported on Line 18. I'm not sure if that is the reason you see the error on Line 18. |
Is it an easy way to fix it at details.phtml? |
I got a fix at https://github.com/magento/magento2/pull/22034/files, please take a look. |
i have seen it, but i have not |
oh, it should be under the |
Yes... i had installed it with composer. |
Sounds good. I see a document about how to apply a patch, but I have not tried it yet. I installed my instance with a cloned repository which takes the fix. |
"I am working on this at #dmcdindia19” |
@abhi-ranosys thank you for joining. Please accept team invitation here and self-assign the issue. |
I am working on this at #dmcdindia19 |
Hi @abhi-ranosys. Thank you for working on this issue.
|
Yes its works .. Direct path will be |
same issue when I try to fix it with given solution .. it gives me following error #1 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56] #2 Magento\Framework\ObjectManager\ObjectManager->create() called at [vendor/magento/framework/View/Element/BlockFactory.php:46] #3 Magento\Framework\View\Element\BlockFactory->createBlock() called at [vendor/magento/framework/View/Layout/Generator/Block.php:268] #4 Magento\Framework\View\Layout\Generator\Block->getBlockInstance() called at [vendor/magento/framework/View/Layout/Generator/Block.php:248] #5 Magento\Framework\View\Layout\Generator\Block->createBlock() called at [vendor/magento/framework/View/Layout/Generator/Block.php:226] #6 Magento\Framework\View\Layout\Generator\Block->generateBlock() called at [vendor/magento/framework/View/Layout/Generator/Block.php:134] #7 Magento\Framework\View\Layout\Generator\Block->process() called at [vendor/magento/framework/View/Layout/GeneratorPool.php:81] #8 Magento\Framework\View\Layout\GeneratorPool->process() called at [vendor/magento/framework/View/Layout.php:343] #9 Magento\Framework\View\Layout->generateElements() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:89] #10 Magento\Framework\View\Layout\Interceptor->generateElements() called at [vendor/magento/framework/View/Layout/Builder.php:129] #11 Magento\Framework\View\Layout\Builder->generateLayoutBlocks() called at [vendor/magento/framework/View/Page/Builder.php:55] #12 Magento\Framework\View\Page\Builder->generateLayoutBlocks() called at [vendor/magento/framework/View/Layout/Builder.php:65] #13 Magento\Framework\View\Layout\Builder->build() called at [vendor/magento/framework/View/Page/Config.php:224] #14 Magento\Framework\View\Page\Config->build() called at [vendor/magento/framework/View/Page/Config.php:237] #15 Magento\Framework\View\Page\Config->publicBuild() called at [vendor/magento/framework/View/Result/Page.php:242] #16 Magento\Framework\View\Result\Page->render() called at [vendor/magento/framework/View/Result/Layout.php:171] #17 Magento\Framework\View\Result\Layout->renderResult() called at [vendor/magento/framework/Interception/Interceptor.php:58] #18 Magento\Framework\View\Result\Page\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138] #19 Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153] #20 Magento\Framework\View\Result\Page\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/Result/Page/Interceptor.php:130] #21 Magento\Framework\View\Result\Page\Interceptor->renderResult() called at [vendor/magento/framework/App/Http.php:141] #22 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24] #23 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:261] #24 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:40]` Any help? |
Think I'm seeing this issue on Magento 2.3.5 after upgrading from 2.2.0.
$block->getProduct() is null.
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
chown -R www-data:www-data . Note: After applying the fix from https://github.com/magento/magento2/pull/22034/files it gives another error. Is there a patch for this that we can apply with composer or do I just have to upgrade to 2.4.x? |
We are sorry that you faced a backwards-incompatible change since that was released some time ago, any action now would create other problems. Closing this issue as there is not a real fix for it. |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
The problem is a new block class introduced in 2.3.1, while it doesn't provide the getProduct() method. It's not backward compatible. Created the pull request as well.
The text was updated successfully, but these errors were encountered: