cancel
Showing results for 
Search instead for 
Did you mean: 

Exception when filtering by category in Layered Navigation (Bucket does not exist)

Exception when filtering by category in Layered Navigation (Bucket does not exist)

Hi,

 

I upgraded magento CE 2.1.9 to CE 2.2.0 and now I get an exception when trying to filter by category in the layered navigation. My base category is set as anchor and when I select a sub category I get the following error:

 

1 exception(s):
Exception #0 (Magento\Framework\Exception\StateException): Bucket does not exist

Exception #0 (Magento\Framework\Exception\StateException): Bucket does not exist
#0 /var/www/html/generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext/Collection/Interceptor.php(115): Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection->getFacetedData('category')
#1 /var/www/html/vendor/magento/module-catalog-search/Model/Layer/Filter/Category.php(111): Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection\Interceptor->getFacetedData('category')
#2 /var/www/html/vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php(202): Magento\CatalogSearch\Model\Layer\Filter\Category->_getItemsData()
#3 /var/www/html/vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php(159): Magento\Catalog\Model\Layer\Filter\AbstractFilter->_initItems()
#4 /var/www/html/vendor/magento/module-catalog/Model/Layer/Filter/AbstractFilter.php(148): Magento\Catalog\Model\Layer\Filter\AbstractFilter->getItems()
...

I'm completely stuck with this. Does anyone has a clue about this?

 

Thanks!

4 REPLIES

Re: Exception when filtering by category in Layered Navigation (Bucket does not exist)

I've got the same problem. Any solutions?

Re: Exception when filtering by category in Layered Navigation (Bucket does not exist)

I am also facing same error after upgrading magento from 2.1.9 to 2.2.2. Is there any solution ??

Re: Exception when filtering by category in Layered Navigation (Bucket does not exist)

Have you resolved this error??

Re: Exception when filtering by category in Layered Navigation (Bucket does not exist)

I have added below code on above "Bucket does not exist" condition. Because we are showing subcategories on main category pages. So we don't need filters. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category'); if($category && $category->getIsAnchor() == '0'){ return ''; } if (!$bucket) { throw new StateException(new Phrase('Bucket does not exist')); }