-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
25038 Only set collection to toolbar once in ListProduct block #26934
25038 Only set collection to toolbar once in ListProduct block #26934
Conversation
Fix for: magento#25038 When using ElasticSearch, pagination does not work in some cases if pagination is set multiple times (in the toolbar). The catalog does not show results when clicking past the first page of results in catalog. Only setting the $collection once fixes the issue.
Hi @wigman. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @m2-assistant[bot] Here is your new Magento Instance: https://undefined |
@@ -516,7 +517,9 @@ private function configureToolbar(Toolbar $toolbar, Collection $collection) | |||
$toolbar->setModes($modes); | |||
} | |||
// set collection to toolbar and apply sort | |||
$toolbar->setCollection($collection); | |||
if (!$toolbar->getCollection()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not really logical to solve issues with initializing toolbar object in the client code. In case if someone use it in custom module - issue will appear again. I think it should be moved inside Toolbar class as internal logic.
I'm not totally sure what is the best solution would be there, but not setting collection not looks logically here.
Could you describe with more details how issue actually appears?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wigman could you check my review above?
@wigman I am closing this PR now due to inactivity. |
Hi @wigman, thank you for your contribution! |
Fix for: #25038
When using ElasticSearch, pagination does not work in some cases if pagination is set multiple times (in the toolbar).
The catalog does not show results when clicking past the first page of results in catalog.
Only setting the $collection once fixes the issue.