cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3 - Layered Filterable attributes getting Undefined offset error

Magento 2.3 - Layered Filterable attributes getting Undefined offset error

I am using magento 2.3.4 ver, i am getting following error if i try to apply filter,

 

Error Screenshot  https://snipboard.io/1Yi3nZ.jpg

 

Error:

Exception #0 (Exception): Notice: Undefined offset: -298 in /var/www/html/test/vendor/magento/framework/Search/Dynamic/Algorithm.php on line 302

 

How to solve this issue?

2 REPLIES 2

Re: Magento 2.3 - Layered Filterable attributes getting Undefined offset error

@Aveeva can you try by replacing the below code in the file in which you are getting the exception.

 

$lastValue = $values[$intervalValuesCount - 1];
//Replace it with below code
$lastValue = isset($values[$intervalValuesCount - 1]) ? $values[$intervalValuesCount - 1] : $values[count($values) - 1];

Hope it hepls!

 

Thanks

Re: Magento 2.3 - Layered Filterable attributes getting Undefined offset error

@rahulGupta  After update your code, still getting some error,

 

Error Screenshot :

Console Error:  https://snipboard.io/XTQwtU.jpg

Source Error: https://snipboard.io/6T4QJ8.jpg

Network Error: https://snipboard.io/N0izeu.jpg

 

Any help, Thank You.