Closed Hailong closed 4 years ago
The PR#22034 request has been approved, but I'm not sure how to update the status of this bug.
:white_check_mark: Confirmed by @shikhamis11
Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-98977
were created
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
at app/design/frontend/Smartwave/porto/Magento_Catalog/templates/product/view/details.phtml on line 18
$page_type = $_product->getData('product_page_type'); if(!$page_type) $page_type = isset($_config['product_page_type'])?$_config['product_page_type']:'';
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 app/code/Magento/Catalog/Block/Product/View/Details.php
oh, it should be under the vendor
directory if you installed it with composer.
Yes... i had installed it with composer. The fix work! Thank you!
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. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
[ ] 1. Add/Edit Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 2. Verify that the issue is reproducible on 2.3-develop
branchDetails
- Add the comment @magento-engcom-team give me 2.3-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop
branch, please, add the label Reproduced on 2.3.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 3. Verify that the issue is reproducible on 2.2-develop
branch. Details
- Add the comment @magento-engcom-team give me 2.2-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.2-develop
branch, please add the label Reproduced on 2.2.x
[ ] 4. If the issue is not relevant or is not reproducible any more, feel free to close it.
oh, it should be under the
vendor
directory if you installed it with composer.
Yes its works .. Direct path will be /vendor/magento/module-catalog/Block/Product/View
same issue when I try to fix it with given solution .. it gives me following error `1 exception(s): Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Magento\Catalog\Block\Product\View\Details\Interceptor Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Magento\Catalog\Block\Product\View\Details\Interceptor
#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.
Fatal error: Uncaught Error: Call to a member function getSomeAttribute() on null in /var/www/html/app/design/frontend/Alothemes/default/Magento_Catalog/templates/product/view/details.phtml:15 Stack trace: #0 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include() #1 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Details\Interceptor), '/var/www/html/a...', Array) #2 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent('render', Array) #3 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Catalog\Block\Product\View\Details\Interceptor), '/var/www/html/a...', Array) #4 /var/www/html/generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php(26): Magento\Fr in /var/www/html/app/design/frontend/Alothemes/default/Magento_Catalog/templates/product/view/details.phtml on line 15
$block->getProduct() is null.
Exception #0 (Magento\Framework\Exception\RuntimeException): Type Error occurred when creating object: Magento\Catalog\Block\Product\View\Details\Interceptor
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. But after I run upgrade, di compile it fixes it. Thanks very much.
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.