Smile-SA / elasticsuite

Smile ElasticSuite - Magento 2 merchandising and search engine built on ElasticSearch
https://elasticsuite.io
Open Software License 3.0
762 stars 339 forks source link

Recursivity Problem #273

Closed maximehuran closed 7 years ago

maximehuran commented 7 years ago

One user on Magento backend modified a category and put the Virtual Root ID with the current category. It's not a good input but you can save the form and in front, it makes an infinite recursion.

This is on the file : vendor/smile/elasticsuite/src/module-elasticsuite-virtual-category/Model/Rule.php On the method : getCategorySearchQuery

if $parentCategory ID = $category ID, not do the recursion.

afoucret commented 7 years ago

The recursivity problem has to be fixed. It would be even better if we were able to avoid such an invalid input.

maximehuran commented 7 years ago

We had another problem with this recursion. It's like the first but the condition is the virtual root ID of a category is an ID of it's parent.

afoucret commented 7 years ago

Hi @maximehuran, can you tell us what version of ElasticSuite are you using and if the problem(s) is still present in the latest branch (2.3.x). Some refactoring have been done in this area and it the problem may have been fix already.

maximehuran commented 7 years ago

smile/elasticsuite 2.2.5 Smile ElasticSuite - Magento2 Merchandising built on ElasticSearch

afoucret commented 7 years ago

@maximehuran thx for the feedback Can you test the 2.3.x branch and give us a feedback on it ?

romainruaud commented 7 years ago

For me, on ElasticSuite 2.3.x branch :

I'll try to provide a fix to prevent user from submitting such an invalid input when editing a virtual category.

In the meantime, could you confirm the behaviour on the 2.3.x branch @maximehuran ?

BR

maximehuran commented 7 years ago

I will test it as fast as possible and give you the feedback

-- [image: Logo Magento] Maxime Huran Développeur Magento / Magento Developper maxime.huran@gmail.com Site français : www.maximehuran.fr English website : www.maximehuran.fr/en

Le mer. 4 janv. 2017 à 11:33, Romain Ruaud notifications@github.com a écrit :

For me, on ElasticSuite 2.3.x branch :

-

having a virtual category with the root id set to itself : no infinite recursion in front, but resulting in erratic results (rules of the category are not applied).

having a virtual category with the root id of one of its parents : no infinite recursion in front, and the conditions applied are correct : these are a combination of the current virtual category and the one set as root.

I'll try to provide a fix to prevent user from submitting such an invalid input when editing a virtual category.

In the meantime, could you confirm the behaviour on the 2.3.x branch @maximehuran https://github.com/maximehuran ?

BR

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Smile-SA/elasticsuite/issues/273#issuecomment-270341261, or mute the thread https://github.com/notifications/unsubscribe-auth/AK2nk2EZZSvOzf51K-qLNbBl1ifdM0IUks5rO3WTgaJpZM4LY4aY .

maximehuran commented 7 years ago

Hi,

I tested to update to 2.3 branch but here is the message :

- The requested package smile/elasticsuite ^2.3 is satisfiable by

smile/elasticsuite[2.3.x-dev] but these conflict with your requirements or minimum-stability.

So I put my minimum stability to "dev" in order to make the test.

I still can save the problematic input, but on frontend no problem, the page is loading. I see you added the $excludedCategories variable to the model.

When the branch will become "alpha" ?

Thank you for your help

-- [image: Logo Magento] Maxime Huran Développeur Magento / Magento Developper maxime.huran@gmail.com Site français : www.maximehuran.fr English website : www.maximehuran.fr/en

Le mer. 4 janv. 2017 à 11:39, Maxime Huran maxime.huran@gmail.com a écrit :

I will test it as fast as possible and give you the feedback

-- [image: Logo Magento] Maxime Huran Développeur Magento / Magento Developper maxime.huran@gmail.com Site français : www.maximehuran.fr English website : www.maximehuran.fr/en

Le mer. 4 janv. 2017 à 11:33, Romain Ruaud notifications@github.com a écrit :

For me, on ElasticSuite 2.3.x branch :

-

having a virtual category with the root id set to itself : no infinite recursion in front, but resulting in erratic results (rules of the category are not applied).

having a virtual category with the root id of one of its parents : no infinite recursion in front, and the conditions applied are correct : these are a combination of the current virtual category and the one set as root.

I'll try to provide a fix to prevent user from submitting such an invalid input when editing a virtual category.

In the meantime, could you confirm the behaviour on the 2.3.x branch @maximehuran https://github.com/maximehuran ?

BR

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Smile-SA/elasticsuite/issues/273#issuecomment-270341261, or mute the thread https://github.com/notifications/unsubscribe-auth/AK2nk2EZZSvOzf51K-qLNbBl1ifdM0IUks5rO3WTgaJpZM4LY4aY .

afoucret commented 7 years ago

Hi @maximehuran,

First you can use composer require "smile/elasticsuite:^2.3@dev" if you don't want to change the minimum stability globally for your project.

Second, we plan to release the 2.3.0 next week (maybe tomorrow if we are fast enough to execute our release process and updating the documentation).

Thank you for reporting and for your feedback

BR