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

BUG: GridFieldOrderableRows interaction with GridFieldPaginator #355

Open
mfendeksilverstripe opened this issue Jan 22, 2023 · 1 comment

Comments

@mfendeksilverstripe
Copy link
Contributor

mfendeksilverstripe commented Jan 22, 2023

BUG: GridFieldOrderableRows interaction with GridFieldPaginator

Impacted version: 3.5.0

Re-ordering items across pages produces unexpected results.

Steps to reproduce

  • taxonomy group <- many many through (with Sort on through object) -> taxonomy term (also has a Sort column)
  • generate a taxonomy group with 200 taxonomy terms
  • navigate to a page (for example page 4)
  • drag an items to be reordered (for example item number 50) and drop it on the previous page icon in the paginator

Expected result

Item number 50 will be moved to the previous page while leaving all the items in the same place

Actual result

The list gets completely shifted with first 44 items leaving their place on the first page.

Screenshots

Screen Shot 2023-01-23 at 8 31 59 AM

Screen Shot 2023-01-23 at 8 32 16 AM

Screen Shot 2023-01-23 at 8 33 25 AM

Notes

I haven't done too much investigation into this but it's possible that the random sort order is coming from the Sort column on the taxonomy terms. Maybe the re-order action gets confused on which DB column needs to be used when using the paginator reorder.

Normal reorder action within a single page works fine though.

PRs

johannesx75 pushed a commit to johannesx75/silverstripe-gridfieldextensions that referenced this issue Sep 21, 2024
If a many_many relation with the sort in an many_many_extraField has an item draged to another page the resulting sort
is wrong. This was caused by the handleMoveToPage function not respecting the original sort of the list.
@johannesx75
Copy link

I think I've found the problem. The code that tried to figure out the new sort did not respect the original sort of the DataList. I've created a pull request for the 4.x branch: #418

johannesx75 pushed a commit to johannesx75/silverstripe-gridfieldextensions that referenced this issue Sep 25, 2024
If a many_many relation with the sort in an many_many_extraField has an item draged to another page the resulting sort
is wrong. This was caused by the handleMoveToPage function not respecting the original sort of the list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants