-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Error: Call to a member function getUrl() on null in vendor/magento/module-catalog/view/frontend/templates/category/image.phtml:21 #30753
Comments
Hi @primafair. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Or maybe this is bug but no body notice or can reproduce exactly scenario |
@primafair: you're probably using the So adjust your xml like it was done in 6fc1e3c#diff-e83ea1b571c022bdf3362f880222c12bf800ecbcbbeb6765b8f327754f8b9a33 and you should be up and running again. Magento architects are currently discussing such issues and are figuring out if these can be seen as backwards incompatible. So when they decide that these kind of changes are backwards incompatible, they will no longer allow such changes to be made in the future. |
seem a lot of customise theme will break after this |
I encountered this going from 2.3.5 to 2.3.6 |
I can confirm that I'm having this issue after upgrading from CE 2.3.4 to 2.4.1. |
Even I am facing the same issue after upgrading from 2.3.5 to 2.4.1 |
You should check file view.xml in folder etc of your theme. Maybe you miss some variables that cause problem |
I confirm that this solution is working well, but I do not suggest to roll back Magento changes but it is better (as you said )to fix the xml file by adding those two arguments , this is worked for me |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Is this issue still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? Thank you for your contributions! |
Posting a comment. Issues should not be automatically closed. |
Indeed, this issue should be closed, can somebody do that please, maybe @ihor-sviziev? Thanks! 🙂 |
Closing this issue, as we have a solution in #30753 (comment) |
I found the issue is our theme. Our theme follows the old standard, they don't have an argument when they call the image. Magento 2.4.4 try to add some arguments when they call the image in category pages. So, I just change the code to call the image in the file app/design/frontend/Alothemes/default/Magento_Catalog/layout/catalog_category_view.xml From: To:
Note: change Alothemes/default to your theme. Hope it helps someone! |
Preconditions (*)
the category pages can no longer be accessed after upgrading from Magento 2.3.5 to Magento 2.4.1, we get the following message
Has anyone else encountered the problem? How do I fix this bug? Thanks a lot
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Error: Call to a member function getUrl() on null in vendor/magento/module-catalog/view/frontend/templates/category/image.phtml:21 Stack trace: #0 vendor/magento/framework/View/TemplateEngine/Php.php(71): include() #1 vendor/magento/framework/View/Element/Template.php(273): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Category\View), '/home/stubenbl/...', Array) #2 vendor/magento/framework/View/Element/Template.php(303): Magento\Framework\View\Element\Template->fetchView('/home/stubenbl/...') #3 vendor/magento/framework/View/Element/AbstractBlock.php(1111): Magento\Framework\View\Element\Template->_toHtml() #4 vendor/magento/framework/View/Element/AbstractBlock.php(1115): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element{closure}() #5 vendor/magento/framework/View/Element/AbstractBlock.php(675): Magento\Framework\View\Element\AbstractBlock->_loadCache() #6 vendor/magento/framework/View/Layout.php(566): Magento\Framework\View\Element\AbstractBlock->toHtml() #7 vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Layout->_renderBlock('category.image') #8 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('category.image') #9 vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('category.image') #10 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('category.image', false) #11 vendor/magento/framework/View/Layout.php(594): Magento\Framework\View\Layout\Interceptor->renderElement('category.image', false) #12 vendor/magento/framework/View/Layout.php(544): Magento\Framework\View\Layout->_renderContainer('category.view.c...', false) #13 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('category.view.c...') #14 vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('category.view.c...') #15 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('category.view.c...', false) #16 vendor/magento/framework/View/Layout.php(594): Magento\Framework\View\Layout\Interceptor->renderElement('category.view.c...', false) #17 vendor/magento/framework/View/Layout.php(544): Magento\Framework\View\Layout->_renderContainer('columns.top', false) #18 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('columns.top') #19 vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('columns.top') #20 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('columns.top', false) #21 vendor/magento/framework/View/Layout.php(594): Magento\Framework\View\Layout\Interceptor->renderElement('columns.top', false) #22 vendor/magento/framework/View/Layout.php(544): Magento\Framework\View\Layout->_renderContainer('main.content', false) #23 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('main.content') #24 vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main.content') #25 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('main.content', false) #26 vendor/magento/framework/View/Layout.php(594): Magento\Framework\View\Layout\Interceptor->renderElement('main.content', false) #27 vendor/magento/framework/View/Layout.php(544): Magento\Framework\View\Layout->_renderContainer('page.wrapper', false) #28 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper') #29 vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper') #30 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('page.wrapper', false) #31 vendor/magento/framework/View/Layout.php(594): Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper', false) #32 vendor/magento/framework/View/Layout.php(544): Magento\Framework\View\Layout->_renderContainer('root', false) #33 generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('root') #34 vendor/magento/framework/View/Layout.php(497): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root') #35 generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('root', true) #36 vendor/magento/framework/View/Layout.php(963): Magento\Framework\View\Layout\Interceptor->renderElement('root') #37 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Layout->getOutput() #38 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Layout\Interceptor->___callParent('getOutput', Array) #39 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception{closure}() #40 generated/code/Magento/Framework/View/Layout/Interceptor.php(347): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array) #41 vendor/magento/framework/View/Result/Page.php(258): Magento\Framework\View\Layout\Interceptor->getOutput() #42 vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor)) #43 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor)) #44 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array) #45 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Response\Http\Interceptor)) #46 generated/code/Magento/Framework/View/Result/Page/Interceptor.php(95): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array) #47 vendor/magento/framework/App/Http.php(120): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor)) #48 generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch() #49 vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http\Interceptor->launch() #50 index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor)) #51 {main}
The text was updated successfully, but these errors were encountered: