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

Couldn't select all items on Review grid #12594

Closed
paul-at-straker opened this issue Dec 7, 2017 · 23 comments
Closed

Couldn't select all items on Review grid #12594

paul-at-straker opened this issue Dec 7, 2017 · 23 comments
Labels
Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. stale issue Triage: Done Has been reviewed and prioritized during Triage with Product Managers

Comments

@paul-at-straker
Copy link

paul-at-straker commented Dec 7, 2017

I couldn't select all items on review grid.

Preconditions

  1. Magento 2.2.1
  2. PHP 7.1.12

Steps to reproduce

  1. login Magento admin
  2. from main menu, select MARKETING -> User Content -> Reviews
  3. select Select All under Actions checkbox

Expected result

  1. it should show 346 records found (346 selected)

Actual result

  1. it should show 346 records found (20 selected)
@paul-at-straker paul-at-straker changed the title Couldn't select all item on Review grid Couldn't select all items on Review grid Dec 7, 2017
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Dec 7, 2017
@magento-engcom-team
Copy link
Contributor

@paul-at-straker, thank you for your report.
We've created internal ticket(s) MAGETWO-85227 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Dec 8, 2017
@osrecio
Copy link
Member

osrecio commented Dec 12, 2017

The problem is due to: MassAction/Extended.php. When try to get: getColumValues from Review\Product\Collection the collection is loaded and only get the first 20 Product Reviews.

In this moment I don't know what is the best way to solve this issue. I will continue investigating.

Thanks for the catch @paul-at-straker

@paul-at-straker
Copy link
Author

As far as know getGridIdsJson() in the version of 2.1.x uses getAllIds instead of getColumValues(). I have tried to replace the entire getGridIdsJson() with the code copied from version 2.1.x, it works. Although I haven't looked at it deeply, it might be helpful.

@osrecio
Copy link
Member

osrecio commented Dec 12, 2017

Yes, This changes was made to allow get Id's not only for primary key: #9610.

@osrecio
Copy link
Member

osrecio commented Dec 15, 2017

Same happens in Grid Notification.

Ivestigating possibilities to fix #9610

@sheenu3091
Copy link

I am working in at #dmcdindia

@magento-engcom-team
Copy link
Contributor

@sheenu3091 thank you for joining. Please accept team invitation here and self-assign the issue.

@jspoe
Copy link

jspoe commented Aug 3, 2018

I would suggest to change this into an ui-component with a proper data-provider instead of the old Grid-block method, to make it future proof and generic with the other grids.
This should fix this bug too.

@jspoe
Copy link

jspoe commented Aug 15, 2018

@magento-engcom-team @okorshenko Do you agree with this approach? If that is the case, I will continue to work on this solution.

@VladimirZaets
Copy link
Contributor

VladimirZaets commented Aug 15, 2018

Hi @jspoe. I agree that this issue should be fixed only in the ui-component grid, no sense to fix it in the old grids.
The correct fix for this issue is replacing the old grid with ui-component grid.
@jspoe As I see the ui-component grid works correctly (screenshots are attached. We can select items per page or all items in all pages), so I don't fully understand the solution in the ui-component grid you said, could you please provide more information?
screen shot 2018-08-15 at 17 57 51
screen shot 2018-08-15 at 17 58 07

@jspoe
Copy link

jspoe commented Aug 16, 2018

@VladimirZaets The scenario where this can be reproduced (Marketing -> User Content -> Reviews) is an old grid. This should be transformed from an old grid into an UiComponent instead of just fix the selection bug of the grid.

Before I spent a couple of hours in transforming the old grid into an UiComponent and removing all the references and files of the old grid. It would be a waste of time if this change was already made in another issue or by another team. Therefor I just wanted to have the confirmation to make this whole change instead of only fix the selection bug. :)

@raisaev
Copy link

raisaev commented Aug 16, 2018

Transforming the Reviews grid to the version based on UiComponent is definitely a good thing.

But the issue can be reproduced on ANY of grids that still use the old approach. Yes, perhaps this is really the last of the grids that do not use UiComponent in Magento Core but there can be a lot in other extensions written for M2.

A good solution is to do both:

  • fix the selection bug for all old grids
  • transform Reviews grid to the UiComponent approach

@jspoe
Copy link

jspoe commented Aug 17, 2018

Agreed, I'll work on the bugfix first then and make a pull request for the UiComponent afterwards.

@jspoe
Copy link

jspoe commented Sep 14, 2018

Debugged this right down to the problem, with the given information of #9610

The problem is the fact that the change to getColumnValues() did not take in account that a collection already could be loaded with a given limit. In the case of the toolbar of the review grid. The collection gets loaded and the default methods to reset it are not possible, because of an afterLoad in Model/ResourceModel/Review.php that joins the store table onto it. That will result in a correlation error because the afterLoad method will be called twice.

Solution in this case might be to have a cloned version of an (yet) unloaded collection in Magento/Backend/Block/Widget/Grid/Extended.php. But that is not a solid solution either, because you'll have a second collection in your object and thus maks the object heavier than it should be. I also thought of the getSelectCountSql() that is available in most collections and in the AbstractDb class, but that might also result in some unwanted constructions because you could miss the column that you want to use.

@VladimirZaets VladimirZaets added Priority: P3 May be fixed according to the position in the backlog. Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. labels Jul 22, 2020
@magento-engcom-team magento-engcom-team added the Triage: Done Has been reviewed and prioritized during Triage with Product Managers label Jul 22, 2020
@m2-community-project m2-community-project bot added Progress: PR Created Indicates that Pull Request has been created to fix issue and removed Progress: PR in progress Progress: ready for dev labels Sep 3, 2020
@ghost ghost added Progress: ready for dev and removed Progress: PR Created Indicates that Pull Request has been created to fix issue labels Sep 4, 2020
@stale
Copy link

stale bot commented Dec 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 14 days if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. stale issue Triage: Done Has been reviewed and prioritized during Triage with Product Managers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.