cancel
Showing results for 
Search instead for 
Did you mean: 

search not working - Fatal error - magento 2

search not working - Fatal error - magento 2

My website is in Magento ver. 2.2.3 early my search functionality was working properly ..but no idea suddenly from last week i am getting below error message ...

 

Fatal error: Uncaught Error: Call to a member function getNext() on null in /home/website/public_html/generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor/Interceptor.php:1465 Stack trace: #0 /home/website/public_html/generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor/Interceptor.php(13): Magento\Catalog\Block\Product\ListProduct\Interceptor\Interceptor->___init() #1 /home/website/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Catalog\Block\Product\ListProduct\Interceptor\Interceptor->__construct(Object(Magento\Catalog\Block\Product\Context), Object(Magento\Framework\Data\Helper\PostHelper), Object(Magento\Catalog\Model\Layer\Resolver), Object(Magento\Catalog\Model\CategoryRepository\Interceptor), Object(Magento\Framework\Url\Helper\Data), Array) #2 /home/website/public_html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Catalog...', in /home/website/public_html/generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor/Interceptor.php on line 1465

 

below is above path interceptor.php code line 1465:

 

> /** > * {@inheritdoc} > */ >

public function ___init() > { > $pluginInfo = $this->pluginList->getNext($this->subjectType, '___init'); > if (!$pluginInfo) { > return parent::___init(); > } else { > return $this->___callPlugins('___init', func_get_args(), $pluginInfo); > } > } > > /** > * {@inheritdoc} > */ > public function ___callParent($method, array $arguments) > { > $pluginInfo = $this->pluginList->getNext($this->subjectType, '___callParent'); > if (!$pluginInfo) { > return parent::___callParent($method, $arguments); > } else { > return $this->___callPlugins('___callParent', func_get_args(), $pluginInfo); > } > }

 

i tried :

Delete generated/code and generated/meta

and not delete htaccess under generated.

Flush the cache.

also did upgrade cmd ..

 

but still getting above error message .... as new to magento2 - no idea what going wrong ... thanks

13 REPLIES 13

Re: search not working - Fatal error - magento 2

Hi @shashib

 

I understand the problem which you are facing ,just follow the below steps and run commands sequentially !

 

rm -rf generated
rm -rf var/cache
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:clean
php bin/magento cache:flush

Then check it will works , as the error log displayed over here is coming from generated directory itself !

if issue solved,Click Kudos & Accept as Solution

Re: search not working - Fatal error - magento 2

dont what happen ... but

website is seen broken ... no css ...nothing

 

 

Re: search not working - Fatal error - magento 2

Hi @shashib

 

Yes , now you need to run below command and everything works correct !

 

php bin/magento setup:static-content:deploy -f 
php bin/magento cache:clean
php bin/magento cache:flush

Run above commands and check it will works !

if issue solved,Click Kudos & Accept as Solution

Re: search not working - Fatal error - magento 2

no still error ..same

Re: search not working - Fatal error - magento 2

Hi @shashib

 

So still the same error which is showing above ?

if issue solved,Click Kudos & Accept as Solution

Re: search not working - Fatal error - magento 2

Fatal error: Uncaught Error: Call to a member function getNext() on null in /home/website/public_html/generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor/Interceptor.php:1465 Stack trace: #0 /home/website/public_html/generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor/Interceptor.php(13): Magento\Catalog\Block\Product\ListProduct\Interceptor\Interceptor->___init() #1 /home/website/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Catalog\Block\Product\ListProduct\Interceptor\Interceptor->__construct(Object(Magento\Catalog\Block\Product\Context), Object(Magento\Framework\Data\Helper\PostHelper), Object(Magento\Catalog\Model\Layer\Resolver), Object(Magento\Catalog\Model\CategoryRepository\Interceptor), Object(Magento\Framework\Url\Helper\Data), Array) #2 /home/website/public_html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Catalog...', in /home/website/public_html/generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor/Interceptor.php on line 1465

Re: search not working - Fatal error - magento 2

one thing i noted ...

if i delete generated folder .. in second only its auto created  with magento folder auto

Re: search not working - Fatal error - magento 2

one thing i noted ...

if i delete generated folder .. in 1 second only its auto created  with magento folder auto

Re: search not working - Fatal error - magento 2

you der frd