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

25038 Only set collection to toolbar once in ListProduct block #26934

Closed

Conversation

wigman
Copy link
Contributor

@wigman wigman commented Feb 19, 2020

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.

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.
@m2-assistant
Copy link

m2-assistant bot commented Feb 19, 2020

Hi @wigman. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@magento-deployment-service
Copy link

Hi @m2-assistant[bot] Here is your new Magento Instance: https://undefined
Admin access: https://undefined/undefined
Login: undefined , Password: undefined

@magento-engcom-team magento-engcom-team added Release Line: 2.4 partners-contribution Pull Request is created by Magento Partner and removed Component: Elasticsearch labels Feb 19, 2020
@engcom-Golf engcom-Golf self-assigned this Feb 20, 2020
@engcom-Golf engcom-Golf added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Feb 20, 2020
@ihor-sviziev ihor-sviziev self-assigned this Feb 20, 2020
@ghost ghost added the Progress: review label Feb 20, 2020
@@ -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()) {
Copy link
Contributor

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?

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a 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?

@ihor-sviziev
Copy link
Contributor

@wigman I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for the collaboration!

@m2-assistant
Copy link

m2-assistant bot commented Mar 12, 2020

Hi @wigman, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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

Successfully merging this pull request may close these issues.

5 participants