Skip to content
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

Magento CE 2.4.4-p2 Frontend product search PHP 8.1 error #37332

Closed
1 of 5 tasks
kisfelix opened this issue Apr 4, 2023 · 5 comments
Closed
1 of 5 tasks

Magento CE 2.4.4-p2 Frontend product search PHP 8.1 error #37332

kisfelix opened this issue Apr 4, 2023 · 5 comments
Assignees
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.4-p2

Comments

@kisfelix
Copy link

kisfelix commented Apr 4, 2023

Preconditions and environment

Magento CE 2.4.4-p2, PHP 8.1

Steps to reproduce

Search for product with search field (/catalogsearch/result/?cat=&q=ring)

Expected result

Search results in proper HTML layout

Actual result

Broken HTML code with following error displayed on page

TypeError: Magento\Catalog\Model\ResourceModel\Product\Collection::addCategoryFilter(): Argument #1 ($category) must be of type Magento\Catalog\Model\Category, null given, called in /home/[ACCOUNTNAME]/public_html/app/code/Blueskytechco/LayeredAjax/ViewModel/Layered.php on line 62 and defined in /home/[ACCOUNTNAME]/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php:913
Stack trace:
#0 /home/[ACCOUNTNAME]/public_html/app/code/Blueskytechco/LayeredAjax/ViewModel/Layered.php(62): Magento\Catalog\Model\ResourceModel\Product\Collection->addCategoryFilter(NULL)
#1 /home/[ACCOUNTNAME]/public_html/app/code/Blueskytechco/LayeredAjax/view/frontend/templates/layer/filter.phtml(64): Blueskytechco\LayeredAjax\ViewModel\Layered->getPriceRange()
#2 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/home/[ACCOUNTNAME]...')
#3 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\LayeredNavigation\Block\Navigation\FilterRenderer\Interceptor), '/home/[ACCOUNTNAME]...', Array)
#4 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView('/home/[ACCOUNTNAME]...')
#5 /home/[ACCOUNTNAME]/public_html/vendor/magento/module-layered-navigation/Block/Navigation/FilterRenderer.php(29): Magento\Framework\View\Element\Template->_toHtml()
#6 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\LayeredNavigation\Block\Navigation\FilterRenderer->render(Object(Magento\CatalogSearch\Model\Layer\Filter\Price))
#7 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\LayeredNavigation\Block\Navigation\FilterRenderer\Interceptor->___callParent('render', Array)
#8 /home/[ACCOUNTNAME]/public_html/vendor/magento/module-swatches/Model/Plugin/FilterRenderer.php(63): Magento\LayeredNavigation\Block\Navigation\FilterRenderer\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\CatalogSearch\Model\Layer\Filter\Price))
#9 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Swatches\Model\Plugin\FilterRenderer->aroundRender(Object(Magento\LayeredNavigation\Block\Navigation\FilterRenderer\Interceptor), Object(Closure), Object(Magento\CatalogSearch\Model\Layer\Filter\Price))
#10 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\LayeredNavigation\Block\Navigation\FilterRenderer\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\CatalogSearch\Model\Layer\Filter\Price))
#11 /home/[ACCOUNTNAME]/public_html/generated/code/Magento/LayeredNavigation/Block/Navigation/FilterRenderer/Interceptor.php(23): Magento\LayeredNavigation\Block\Navigation\FilterRenderer\Interceptor->___callPlugins('render', Array, NULL)
#12 /home/[ACCOUNTNAME]/public_html/app/code/Blueskytechco/LayeredAjax/view/frontend/templates/layer/view.phtml(63): Magento\LayeredNavigation\Block\Navigation\FilterRenderer\Interceptor->render(Object(Magento\CatalogSearch\Model\Layer\Filter\Price))
#13 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/home/[ACCOUNTNAME]...')
#14 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\LayeredNavigation\Block\Navigation), '/home/[ACCOUNTNAME]...', Array)
#15 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView('/home/[ACCOUNTNAME]...')
#16 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(1095): Magento\Framework\View\Element\Template->_toHtml()
#17 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(1099): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element{closure}()
#18 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(660): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#19 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(578): Magento\Framework\View\Element\AbstractBlock->toHtml()
#20 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock('catalogsearch.l...')
#21 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('catalogsearch.l...')
#22 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement('catalogsearch.l...', false)
#23 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('sidebar.main', false)
#24 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('sidebar.main')
#25 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement('sidebar.main', false)
#26 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('div.sidebar.mai...', false)
#27 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('div.sidebar.mai...')
#28 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement('div.sidebar.mai...', false)
#29 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('columns', false)
#30 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('columns')
#31 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement('columns', false)
#32 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('main.content', false)
#33 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('main.content')
#34 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement('main.content', false)
#35 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('page.wrapper', false)
#36 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')
#37 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout->renderElement('page.wrapper', false)
#38 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('root', false)
#39 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout->renderNonCachedElement('root')
#40 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Layout.php(975): Magento\Framework\View\Layout->renderElement('root')
#41 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Layout->getOutput()
#42 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Layout\Interceptor->___callParent('getOutput', Array)
#43 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception{closure}()
#44 /home/[ACCOUNTNAME]/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(41): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array)
#45 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Result/Page.php(260): Magento\Framework\View\Layout\Interceptor->getOutput()
#46 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#47 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#48 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#49 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#50 /home/[ACCOUNTNAME]/public_html/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(23): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#51 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/App/View.php(221): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#52 /home/[ACCOUNTNAME]/public_html/vendor/magento/module-catalog-search/Controller/Result/Index.php(168): Magento\Framework\App\View->renderLayout()
#53 /home/[ACCOUNTNAME]/public_html/vendor/magento/module-catalog-search/Controller/Result/Index.php(110): Magento\CatalogSearch\Controller\Result\Index->getNotCacheableResult(Object(Magento\CatalogSearch\Helper\Data), Object(Magento\Search\Model\Query), NULL)
#54 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\CatalogSearch\Controller\Result\Index->execute()
#55 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callParent('execute', Array)
#56 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception{closure}()
#57 /home/[ACCOUNTNAME]/public_html/generated/code/Magento/CatalogSearch/Controller/Result/Index/Interceptor.php(23): Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callPlugins('execute', Array, Array)
#58 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/App/Action/Action.php(111): Magento\CatalogSearch\Controller\Result\Index\Interceptor->execute()
#59 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#60 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callParent('dispatch', Array)
#61 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\CatalogSearch\Controller\Result\Index\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#62 /home/[ACCOUNTNAME]/public_html/generated/code/Magento/CatalogSearch/Controller/Result/Index/Interceptor.php(32): Magento\CatalogSearch\Controller\Result\Index\Interceptor->___callPlugins('dispatch', Array, Array)
#63 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/App/FrontController.php(245): Magento\CatalogSearch\Controller\Result\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#64 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse(Object(Magento\CatalogSearch\Controller\Result\Index\Interceptor), Object(Magento\Framework\App\Request\Http))
#65 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest(Object(Magento\Framework\App\Request\Http), Object(Magento\CatalogSearch\Controller\Result\Index\Interceptor))
#66 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#67 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#68 /home/[ACCOUNTNAME]/public_html/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))
#69 /home/[ACCOUNTNAME]/public_html/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))
#70 /home/[ACCOUNTNAME]/public_html/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php(75): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#71 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#72 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception{closure}(Object(Magento\Framework\App\Request\Http))
#73 /home/[ACCOUNTNAME]/public_html/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, NULL)
#74 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#75 /home/[ACCOUNTNAME]/public_html/vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http->launch()
#76 /home/[ACCOUNTNAME]/public_html/pub/index.php(30): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#77 {main}

Additional information

No response

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
@m2-assistant
Copy link

m2-assistant bot commented Apr 4, 2023

Hi @kisfelix. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 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, join the Community Contributions Triage session to discuss the appropriate ticket.

@m2-assistant
Copy link

m2-assistant bot commented Apr 5, 2023

Hi @engcom-Bravo. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@m2-assistant
Copy link

m2-assistant bot commented Apr 5, 2023

Hi @engcom-Delta. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Delta
Copy link
Contributor

Hi @kisfelix ,

Thank you for reporting and collaboration.
Verified the issue on Magento 2.4-develop instance and PHP 8.1, the issue is not reproducible.

Steps are followed to reproduce

  1. create a product in admin
  2. Search for product with search field (/catalogsearch/result/?q=pen)

Kindly please refer the below screenshot
Screenshot 2023-04-06 at 8 41 02 AM

Search results in proper HTML layout ,Kindly recheck the behavior on Magento 2.4-develop instance and elaborate steps to reproduce if the issue is still reproducible.

Thanks.

@engcom-Delta engcom-Delta added the Issue: needs update Additional information is require, waiting for response label Apr 6, 2023
@engcom-Delta
Copy link
Contributor

Hi @kisfelix ,

We have noticed that this issue has not been updated for a period of 14 Days.

Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: needs update Additional information is require, waiting for response Reported on 2.4.4-p2
Projects
None yet
Development

No branches or pull requests

3 participants