Patch #7594

Proper pagination

Added by Brian Lindahl almost 7 years ago. Updated over 2 years ago.

Status:ClosedStart date:2011-02-09
Priority:HighDue date:
Assignee:-% Done:

50%

Category:UI
Target version:-

Description

There are some serious problems with the way pagination (i.e. issue list) is implemented.
1) back button is broken
2) bookmarking is broken

This patch isn't a perfect fix, but it's a good hack/patch to use while waiting for a more proper solution to this problem. The root cause is based in using Ajax updates for pagination. Since the page isn't changing, the browser history isn't managed, nor is the URL updated. By moving back to direct links for pagination, this problem can be avoided. Note that in this patch, a lot of Ajax parameters are removed so that they don't show up in the URL. This may introduce problems with maintaining said Ajax properties across pagination.

I've introduced a Ruby hash to isolate these problematic parameters and controllers. By updating turning on logging (uncommenting a line in the patch), you can identify the name of the controller and the name of the parameter that needs to be preserved. The name of the parameter can then be added to the hash, keyed by the name of the controller. This parameter will now appear in the URL and the Ajax parameter will be preserved across pagination. Note that I have only noticed this problem in the users controller, when changing the status or the name query.

It appears that issue grouping and issue filtering (the most important Ajax parameters, in my opinion), are preserved across pagination. However, these Ajax parameters are not preserved across bookmarks. Fortunately, saved queries makes this a non-issue.

proper-pagination-1.1.0.patch Magnifier (3.15 KB) Brian Lindahl, 2011-02-09 21:04

proper-pagination-1.1.0.patch Magnifier - bugfix1 (3.15 KB) Brian Lindahl, 2011-02-09 22:00


Related issues

Related to Redmine - Defect #1965: Redmine is not Tab Safe Closed 2008-09-29
Related to Redmine - Defect #657: Back button - loses current page after viewing an issue -... Closed 2008-02-13
Related to Redmine - Defect #3494: Browser "Back" to issue list displays wrong filter Closed 2009-06-13
Duplicates Redmine - Defect #5138: Don't use Ajax for pagination Closed 2010-03-20

History

#1 Updated by Brian Lindahl almost 7 years ago

There are likely issues with this patch that have not been uncovered yet. However, they will not be catastrophic (i.e. trash the database, take down the site, or cause errors in pages). The issues with this patch will most likely be related to Ajax configurations (parameters) of views disappearing when using pagination.

#2 Updated by Brian Lindahl almost 7 years ago

bugfix1:
  • project_id wasn't being preserved, so the project was lost during pagination

#3 Updated by Brian Lindahl almost 7 years ago

related to #1965, #657, #5138, #3494

#4 Updated by Toshi MARUYAMA over 6 years ago

  • Category set to UI

#5 Updated by Go MAEDA over 2 years ago

  • Status changed from New to Closed

Fixed by #5138 (Redmine 1.2.0), removed ajax pagination.

#6 Updated by Go MAEDA over 2 years ago

  • Duplicates Defect #5138: Don't use Ajax for pagination added

Also available in: Atom PDF