silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
721 stars 822 forks source link

New previous & next buttons on GridFieldDetailForms inconsistently work #8955

Closed ScopeyNZ closed 5 years ago

ScopeyNZ commented 5 years ago

Affected Version

>= 4.4.x

Description

Previous & next arrow buttons on GridField detail forms are inconsistent.

Steps to Reproduce

Notes

I've had a little look at this. Not really sure what's causing it but by forcing GridField to run through all GridField_DataManipulator components before calling GridFieldDetailForm_ItemRequest::getAdjacentRecordID it seems to correctly get pagination state - the crux of this issue.

The problem then, however, is that setting the state from the request (in that same method) sometimes clears out the valid state with empty state. Wrapping it in an if(!empty) condition works but I'm not hugely familiar with this implementation.

ScopeyNZ commented 5 years ago

I set impact/high because it's weird choosing a record in a list and having disabled navigation buttons.

unclecheese commented 5 years ago

Closing as associated PR was merged.