-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
All attributes set to be used for search appear in layering navigation when there are no search results #4055
Comments
thanks to @davidhiendl do you have any idea? |
It's possible this problem is caused by newer PHP versions, will need some investigation. I cannot reproduce the problem on my 7.4/8.1 test env's. |
Also cannot reproduce it on a clean 8.2 instance. |
Just to be clear on the reproduction steps:
|
It is not related to the PHP version. DDEV allows me to switch in a second any version from 7.4 to 8.3. If I am using a file version before your change in /app/core/local/... the layering navigation doesn't show the 0 values for all searchable attributes but I get another issue, the search feature is not functioning anymore even for words with results. Steps for reproduction the issue are in the first post. It is not related to products with option. |
It is not related to the PHP version. DDEV allows me to switch in a second any version from 7.4 to 8.3. If I am using a file version before your change in /app/core/local/... the layering navigation doesn't show the 0 values for all searchable attributes but I get another issue, the search feature is not functioning anymore even for words with results. Steps for reproduction the issue are in my initial post. It is not related to products with option. The screenshot below proves the issue I reported. I have created an attribute that has multiple values. I searched for the word "potato" which does not exist, the result can be seen in the image. What changed that PR is that OM displays the "SHOP BY" block on the left side and lists all the attributes set for the search. This is wrong, that block should not be displayed if there are no results. To reproduce the issue that attribute must have the value for [Use in Layered Navigation] set to Filterable (with results). All the attributes that have this value set are displayed in the side block when there are no results, obviously the displayed number is zero. This is the issue we must fix ASAP, because all the stores in production are affected by. |
Okay I've finally managed to reproduce it but the reason is not directly related to EAV PR. |
I appreciate that you took the time to test and it's good that you were able to reproduce the problem. The issue is that no changes should be made in the attributes as long as they worked in that configuration before a recent upgrade. Something happened over time in the source code because I am upgrading an OM from 2022 that works correctly, but by updating to the latest version I noticed this problem. As you mentioned there is an issue there that led me to the file Collection.php. Replacing this file with an old one I can hide the layering navigation when there are no results. |
|
Indeed, it is a problem related to the combination of "Use in Layered Navigation" and "Use in Search Results Layered Navigation". Scenario 1 For a word with results, all values with zero will be displayed for this attribute, which is not correct, because since they are zero, they no longer need to be displayed - they have no links, they consumes layout space on the page, they look terible. Scenario 2 For a word with results, all zero values from scenario 1 are no longer displayed, which is correct. Scenario 3 For a word with no results, all attributes are displayed and the options have the value zero. Here again is a problem. I replaced the entire directory /app/code/core/Mage/CatalogSearch with an older version and the problem disappeared. We have to find out when the OpenMage source code was altered and the initial behavior that we inherited from Magento changed. |
The main cause is |
Latest OM version cloned from the repository, DDEV + PHP 8.2 + MariaDB.
Steps to reproduce this issue:
I investigated this issue in detail and I found that the changes made in this file
/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext/Collection.php
are causing the problem.
IMPORTANT NOTE: I moved forward and I used the file version before the changes and the problem no longer occurs, but I am not able to search for words that returned results before.
I compared the two versions and the changes are many so that I can get to the source of the problem.
The text was updated successfully, but these errors were encountered: