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

Clicking on show more button gives 0 items #3442

Open
ioweb-gr opened this issue Nov 17, 2024 · 13 comments
Open

Clicking on show more button gives 0 items #3442

ioweb-gr opened this issue Nov 17, 2024 · 13 comments
Assignees

Comments

@ioweb-gr
Copy link

ioweb-gr commented Nov 17, 2024

Similar to issue #2998 I'm also getting an empty array for the items.
After debugging I see in function \Smile\ElasticsuiteCatalog\Model\Attribute\LayeredNavAttributesProvider::isLayeredNavAttribute it returns always false. The problem comes from \Smile\ElasticsuiteCatalog\Model\Attribute\LayeredNavAttributesProvider::getList function which checks the property $this->attributes which is an empty array not yet populated.

So I'm assuming there's some sort of initialization that's failing in my case.

If you could provide some insight as to how and when the attributes property is initialized with data, I could dig further

I also don't see anything in di.xml that could have added values to the array or anything that's invoked before it's injected.

Preconditions

Magento Version :2.4.4

ElasticSuite Version : 2.10.23.2

Environment : Developer

Third party modules :

List of enabled modules:
Amasty_Base
Amasty_Geoip
Amasty_Conditions
Amasty_CommonRules
Amasty_CronScheduleList
Amasty_CustomFormsLite
Amasty_Customform
Amasty_Gdpr
Amasty_GdprCookie
PayPal_Braintree
Amasty_GoogleAddressAutocomplete
Amasty_ImageOptimizer
Amasty_ImageOptimizerUi
Amasty_InvisibleCaptcha
Amasty_LazyLoad
Amasty_LazyLoadUi
Amasty_Mage24Fix
Amasty_Mostviewed
Amasty_PageSpeedOptimizer
Amasty_PageSpeedTools
Amasty_Payrestriction
Amasty_ProductAttachment
Apptrian_FacebookCatalog
Apptrian_FacebookPixel
Apptrian_TikTokPixelApi
Bss_FreeShippingBar
Bss_SizeChart
Codazon_AjaxCartPro
Codazon_Core
Codazon_ImproveBundle
Codazon_Lookbookpro
Codazon_MegaMenu
Codazon_PageBuilder
Codazon_ProductFilter
Codazon_ProductLabel
Codazon_QuickShop
Codazon_SalesPro
Codazon_ShippingCostCalculator
Codazon_Slideshow
Codazon_ThemeOptions
Codazon_Utility
Ebizmarts_MailChimp
Esat_Esatisfaction
Harrigo_EverCrumbs
Ho_Templatehints
Ioweb_AmastyGdprAddon
Ioweb_Base
Ioweb_CategoryProductColumns
Ioweb_Checkout
Ioweb_ConfigurableDynamicAttributes
Ioweb_ConfigurableFullPrice
Ioweb_CronMemory
Ioweb_Customizer
Ioweb_EnablePdf
Ioweb_FacebookCatalogOverride
Ioweb_FixStockStatusIssue35494
Ioweb_GoogleRemarketing
Ioweb_Html5
Ioweb_Invoicefields
Ioweb_MariaDbHotfix
Ioweb_MassImageUploader
Ioweb_PiraeusBank
Ioweb_SkroutzFeedVariations
Ioweb_Skroutzfeed
Ioweb_Softone
Ioweb_Toolbox
Ioweb_Wcag
Ioweb_Widgets
MageVision_GreekRegions
Magefan_Community
Magefan_Blog
Magefan_WysiwygAdvanced
Mageplaza_Core
Mageplaza_Smtp
Mageplaza_SocialLogin
Nwdthemes_Base
Nwdthemes_Revslider
Amasty_Checkout
PayPal_BraintreeGraphQl
Smile_ElasticsuiteAdminNotification
Smile_ElasticsuiteCore
Smile_ElasticsuiteCatalog
Smile_ElasticsuiteCatalogGraphQl
Smile_ElasticsuiteCatalogRule
Smile_ElasticsuiteCatalogOptimizer
Smile_ElasticsuiteTracker
Smile_ElasticsuiteThesaurus
Smile_ElasticsuiteSwatches
Smile_ElasticsuiteIndices
Smile_ElasticsuiteAnalytics
Smile_ElasticsuiteVirtualCategory
Swissup_Core
Swissup_SearchMysqlLegacy
Temando_ShippingRemover
Ves_All
Ves_BaseWidget
Ves_PageBuilder
Ves_Setup
Wyomind_Framework
Wyomind_DataFeedManager

List of disabled modules:
Amasty_ShopbyBase
Amasty_Shopby
Amasty_ShopbyBrand
Amasty_ShopbyPage
Amasty_ShopbySeo
Codazon_AjaxLayeredNav
Codazon_AjaxLayeredNavPro
Codazon_GoogleAmpManager
Codazon_Shopbybrandpro
MageWorx_SearchSuiteAutocomplete
Veriteworks_CookieFix

Steps to reproduce

  1. I'm not sure how to reproduce this as I've never faced this issue before. It's a standard installation of the elastic suite and I removed all other modules affecting layered navigation or search.

Expected result

  1. Show more yields more options

Actual result

  1. Show more removes everything from the attribute filter
firefox_tb1o1qNZyY.mp4
@vahonc
Copy link
Collaborator

vahonc commented Nov 18, 2024

@ioweb-gr,

I can try to reproduce this issue, but not sure if I have any luck, cause it looks like this is something specific for your environment.

As for start points for debugging, you can enable logging ES queries in: Stores -> Configuration -> Elasticsuite -> Base settings -> Elasticsearch Client -> Enable Debug Mode and the queries that are being sent to ES when you are browsing categories will be logged into the system.log.

Have you checked errors in Magento logs and in the console of the Dev tools in your browser?

BR,
Vadym

@ioweb-gr
Copy link
Author

Hi @vahonc I know this won't be easy to troubleshoot however there doesn't seem to be any starting point where I can even begin to check at.

I enabled debug mode

[2024-11-18T15:29:36.630884+00:00] main.INFO: Request Success: {"method":"HEAD","uri":"http://localhost:9200/safeblock.yourstaging.eu_gr_catalog_product","port":"9200","headers":{"Host":["localhost"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.16.0 (Linux 6.8.0-48-generic; PHP 7.4.33)"],"x-elastic-client-meta":["es=7.16.0,php=7.4.33,t=7.16.0,a=0,cu=8.5.0"]},"HTTP code":200,"duration":0.000946} []
[2024-11-18T15:29:36.631160+00:00] main.INFO: curl -XHEAD 'http://localhost:9200/safeblock.yourstaging.eu_gr_catalog_product?pretty=true' [] []
[2024-11-18T15:29:36.652702+00:00] main.INFO: Request Success: {"method":"GET","uri":"http://localhost/","port":"9200","headers":{"Host":["localhost"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.16.0 (Linux 6.8.0-48-generic; PHP 7.4.33)"],"x-elastic-client-meta":["es=7.16.0,php=7.4.33,t=7.16.0,a=0,cu=8.5.0"]},"HTTP code":200,"duration":0.000159} []
[2024-11-18T15:29:36.652919+00:00] main.INFO: curl -XGET 'http://localhost/?pretty=true' [] []
[2024-11-18T15:29:36.653395+00:00] main.INFO: Request Success: {"method":"GET","uri":"http://localhost/","port":"9200","headers":{"Host":["localhost"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.16.0 (Linux 6.8.0-48-generic; PHP 7.4.33)"],"x-elastic-client-meta":["es=7.16.0,php=7.4.33,t=7.16.0,a=0,cu=8.5.0"]},"HTTP code":200,"duration":0.000114} []
[2024-11-18T15:29:36.653605+00:00] main.INFO: curl -XGET 'http://localhost/?pretty=true' [] []
[2024-11-18T15:29:36.654991+00:00] main.INFO: Request Success: {"method":"POST","uri":"http://localhost:9200/safeblock.yourstaging.eu_gr_catalog_product/_search","port":"9200","headers":{"Host":["localhost"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.16.0 (Linux 6.8.0-48-generic; PHP 7.4.33)"],"x-elastic-client-meta":["es=7.16.0,php=7.4.33,t=7.16.0,a=0,cu=8.5.0"]},"HTTP code":200,"duration":0.000875} []
[2024-11-18T15:29:36.655365+00:00] main.INFO: curl -XPOST 'http://localhost:9200/safeblock.yourstaging.eu_gr_catalog_product/_search?pretty=true' -d '{"size":0,"query":{"constant_score":{"filter":{"bool":{"must":[{"term":{"stock.is_in_stock":{"value":true,"boost":1}}},{"terms":{"visibility":[2,4],"boost":1}},{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["48"],"boost":1,"_name":"\u039a\u03b1\u03c4\u03b7\u03b3\u03bf\u03c1\u03af\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03bd\u03b1 \u03b1\u03c0\u03cc 48"}}],"must_not":[],"should":[],"boost":1}},"boost":1,"_name":"(1\/2\/48) standard category [\u03a1\u03bf\u03cd\u03c7\u03b1 \u0395\u03c1\u03b3\u03b1\u03c3\u03af\u03b1\u03c2]:48"}},{"bool":{"must_not":[{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"term":{"category.category_id":{"value":48,"boost":1}}},{"term":{"category.is_blacklisted":{"value":true,"boost":1}}}],"must_not":[],"should":[],"boost":1}},"boost":1}}],"boost":1}},{"terms":{"visibility":[2,4],"boost":1}},{"terms":{"option_text_cat.untouched":["48"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"aggregations":{"attribute_set_id":{"terms":{"field":"attribute_set_id","size":10000,"order":{"_count":"desc"}}},"indexed_attributes":{"terms":{"field":"indexed_attributes","size":10000,"order":{"_count":"desc"}}}},"track_total_hits":true}' [] []
[2024-11-18T15:29:36.659246+00:00] main.INFO: Request Success: {"method":"POST","uri":"http://localhost:9200/safeblock.yourstaging.eu_gr_catalog_product/_search","port":"9200","headers":{"Host":["localhost"],"Content-Type":["application/json"],"Accept":["application/json"],"User-Agent":["elasticsearch-php/7.16.0 (Linux 6.8.0-48-generic; PHP 7.4.33)"],"x-elastic-client-meta":["es=7.16.0,php=7.4.33,t=7.16.0,a=0,cu=8.5.0"]},"HTTP code":200,"duration":0.000431} []
[2024-11-18T15:29:36.659470+00:00] main.INFO: curl -XPOST 'http://localhost:9200/safeblock.yourstaging.eu_gr_catalog_product/_search?pretty=true' -d '{"size":0,"query":{"constant_score":{"filter":{"bool":{"must":[{"term":{"stock.is_in_stock":{"value":true,"boost":1}}},{"terms":{"visibility":[2,4],"boost":1}},{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"bool":{"must_not":[{"term":{"category.is_virtual":{"value":true,"boost":1}}}],"boost":1}},{"terms":{"category.category_id":["48"],"boost":1,"_name":"\u039a\u03b1\u03c4\u03b7\u03b3\u03bf\u03c1\u03af\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03bd\u03b1 \u03b1\u03c0\u03cc 48"}}],"must_not":[],"should":[],"boost":1}},"boost":1,"_name":"(1\/2\/48) standard category [\u03a1\u03bf\u03cd\u03c7\u03b1 \u0395\u03c1\u03b3\u03b1\u03c3\u03af\u03b1\u03c2]:48"}},{"bool":{"must_not":[{"nested":{"path":"category","score_mode":"none","query":{"bool":{"must":[{"term":{"category.category_id":{"value":48,"boost":1}}},{"term":{"category.is_blacklisted":{"value":true,"boost":1}}}],"must_not":[],"should":[],"boost":1}},"boost":1}}],"boost":1}},{"terms":{"visibility":[2,4],"boost":1}},{"terms":{"option_text_cat.untouched":["48"],"boost":1}}],"must_not":[],"should":[],"boost":1}},"boost":1}},"aggregations":{"attribute_set_id":{"terms":{"field":"attribute_set_id","size":10000,"order":{"_count":"desc"}}},"indexed_attributes":{"terms":{"field":"indexed_attributes","size":10000,"order":{"_count":"desc"}}}},"track_total_hits":true}' [] []

This is what was added in system.log after clicking show more.

Exception log is clean
There are no console errors just that the controller returns an empty array.

Could you point me to how the \Smile\ElasticsuiteCatalog\Model\Attribute\LayeredNavAttributesProvider::$attributes property should be populated and when?

By debugging after the controller is invoked, I ended up finding that it all happens because this property is empty. So If I can find where it should be populated perhaps we can nail the culprit.

@ioweb-gr
Copy link
Author

Moreover it occurs with all modules disabled and luma active so I don't think it's a conflict this time.

@ioweb-gr
Copy link
Author

@vahonc Any idea where to look next to get any hint of why it's returning empty?

@ioweb-gr
Copy link
Author

@vahonc is it possible to disable the search and show more button temporarily for all filters?

@vahonc
Copy link
Collaborator

vahonc commented Nov 25, 2024

@ioweb-gr

If I understood you correctly, you need to change this setting:

ScreenShot Tool -20241125123444

By default, for all filters display 10 visible options, if there are more than 10 than the "Show more" button is displayed.

You can also edit this parameter of some attribute on the Product Attributes page:

ScreenShot Tool -20241125124542

BR,
Vadym

@ioweb-gr
Copy link
Author

I see, I'll check it out for now if we can live without the show more button. I'd hate to replace the whole suite just for this bug.

I still haven't found a definitive reason of why the \Smile\ElasticsuiteCatalog\Model\Attribute\LayeredNavAttributesProvider::$attributes is never populated when the show more button is pressed.

@vahonc
Copy link
Collaborator

vahonc commented Nov 25, 2024

@ioweb-gr,

I still haven't found a definitive reason of why the \Smile\ElasticsuiteCatalog\Model\Attribute\LayeredNavAttributesProvider::$attributes is never populated when the show more button is pressed.

I'm not sure, but maybe the problem is in special characters (e.g. greek) or something like that. Could you test this issue in an environment with an English locale?

BR,
Vadym

@ioweb-gr
Copy link
Author

ioweb-gr commented Dec 1, 2024

I've confirmed it's not the Greek characters, I've removed all Greek characters from the attribute in the backend, reindex and clear cache. The issue persists even on plain luma with all 3rd party modules disabled. Something else is at play and \Smile\ElasticsuiteCatalog\Model\Attribute\LayeredNavAttributesProvider::$attributes is never populated to verify that the attribute is a layered navigation attribute.

@vahonc
Copy link
Collaborator

vahonc commented Dec 2, 2024

@ioweb-gr,

How many attributes with multi-select type and search ability did you have? Do they all have unexpected behavior?

Could you provide a URL of this store, maybe I can try to take a look on it?

BR,
Vadym

@ioweb-gr
Copy link
Author

ioweb-gr commented Dec 4, 2024

@vahonc By searchable do you mean the is_searchable column in catalog_eav_attribute table?

If so I get 3 results.

However for layered navigation with the is_filterable and is_filterable_in_search columns I have 16

This is what is set for the problematic attribute

+-----------------------------+--------+
|attribute_id                 |141     |
+-----------------------------+--------+
|frontend_input_renderer      |null    |
+-----------------------------+--------+
|is_global                    |1       |
+-----------------------------+--------+
|is_visible                   |1       |
+-----------------------------+--------+
|is_searchable                |1       |
+-----------------------------+--------+
|is_filterable                |1       |
+-----------------------------+--------+
|is_comparable                |1       |
+-----------------------------+--------+
|is_visible_on_front          |1       |
+-----------------------------+--------+
|is_html_allowed_on_front     |0       |
+-----------------------------+--------+
|is_used_for_price_rules      |0       |
+-----------------------------+--------+
|is_filterable_in_search      |1       |
+-----------------------------+--------+
|used_in_product_listing      |1       |
+-----------------------------+--------+
|used_for_sort_by             |0       |
+-----------------------------+--------+
|apply_to                     |null    |
+-----------------------------+--------+
|is_visible_in_advanced_search|1       |
+-----------------------------+--------+
|position                     |0       |
+-----------------------------+--------+
|is_wysiwyg_enabled           |0       |
+-----------------------------+--------+
|is_used_for_promo_rules      |1       |
+-----------------------------+--------+
|is_required_in_admin_store   |0       |
+-----------------------------+--------+
|is_used_in_grid              |1       |
+-----------------------------+--------+
|is_visible_in_grid           |0       |
+-----------------------------+--------+
|is_filterable_in_grid        |1       |
+-----------------------------+--------+
|search_weight                |1       |
+-----------------------------+--------+
|additional_data              |null    |
+-----------------------------+--------+
|is_pagebuilder_enabled       |0       |
+-----------------------------+--------+
|extra_options                |null    |
+-----------------------------+--------+
|is_displayed_in_autocomplete |0       |
+-----------------------------+--------+
|is_used_in_spellcheck        |1       |
+-----------------------------+--------+
|facet_min_coverage_rate      |90      |
+-----------------------------+--------+
|facet_max_size               |10      |
+-----------------------------+--------+
|facet_sort_order             |_count  |
+-----------------------------+--------+
|facet_boolean_logic          |0       |
+-----------------------------+--------+
|is_display_rel_nofollow      |0       |
+-----------------------------+--------+
|display_pattern              |null    |
+-----------------------------+--------+
|display_precision            |0       |
+-----------------------------+--------+
|sort_order_asc_missing       |_last   |
+-----------------------------+--------+
|sort_order_desc_missing      |_first  |
+-----------------------------+--------+
|include_zero_false_values    |0       |
+-----------------------------+--------+
|is_spannable                 |0       |
+-----------------------------+--------+
|norms_disabled               |0       |
+-----------------------------+--------+
|default_analyzer             |standard|
+-----------------------------+--------+

@vahonc
Copy link
Collaborator

vahonc commented Dec 4, 2024

@ioweb-gr,

By searchable do you mean the is_searchable column in catalog_eav_attribute table?

I mean the search field above options of multi-select attributes, just like on your video.

So as, I understand you have one problematic attribute with unexpected behavior. And this attribute has 16 options (values).

Have you tried changing the Facet max size value on the category settings or directly in attribute settings? Does it help to fix your issue, at least temporarily?

BR,
Vadym

@ioweb-gr
Copy link
Author

ioweb-gr commented Dec 5, 2024

@vahonc

The multiselect attribute "material" in my case has approximately 120 Options inside it. Increasing the facet max size to let's say 150 makes the options appear without a searchbox.

I tried to go that way as a workaround but unfortunately due to the sheer amount of possible options the list is unusable without the search box :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants