#7794 "Page Size" preference must actually affect pagination


From https://sourceforge.net/p/allura/tickets/7716/

Changing "Page Size" on /auth/preferences doesn't do anything.

There are a lot of places where page size set manually to some value. E.g. ticket controller sets it to 10, wiki's and discussion to 25, probably there's more places like that.

There are also two helpers used throughout code for pagination g.handle_paging and h.paging_sanitizer. While former is using page size preference, the latter is not.

Other than that g.handle_paging uses some strange (to me) logic. It sets your page size preference to the particular value, if limit is provided (e.g. by manually appending ?limit=N to url, or when hard limit is provided inside the controller). Thus page size is reset in very obscure (to the user) way.

Most obvious and easy to use way would be to always use page size from user preferences for all pages (if it is not overridden by controller for some reason) and avoid resetting this setting as described above.

  • Comments everywhere must use "Page Size" value from user preferences (if is not overridden by ?limit=N url param
  • Probably merge h.paging_sanitizer & g.handle_paging into one to avoid future confusions


  • Dave Brondsema

    Dave Brondsema - 2014-11-03
    • labels: 42cc --> 42cc, sf-1, sf-current
  • Igor Bondarenko - 2014-11-14
    • status: in-progress --> review
  • Igor Bondarenko - 2014-11-14

    Closed #677. ib/7794

    I didn't merge paging_sanitizer & handle_paging, since they are used for slightly different purposes, and sanitizer always requires total count, which is not available in a lot of places where pagination is used.

    I've changed logic of handle_paging to more straightforward and have removed hard pagination limit in controllers, where it made sense.

    Also, I've "greped" through extensions and forge-classic and found only one hard coded limit in mailman app. I didn't change that, though, since we had issues with performance there, so hard limit makes sense to me.

  • Dave Brondsema

    Dave Brondsema - 2014-11-17
    • status: review --> in-progress
    • Reviewer: Dave Brondsema
  • Dave Brondsema

    Dave Brondsema - 2014-11-17

    Looks pretty good, but found 2 minor issues:

    • on the front page of a tracker, the preference isn't used, it still uses 25 for the size. E.g. /p/project1/test-tracker/ in SourceForge's default dataset.
    • If a user doesn't have a preference set, /auth/preferences shows "25" since that's the first item in the drop-down. But handle_paging has default=50, so practically the default default is 50 in most places.
  • Igor Bondarenko - 2014-11-19
    • status: in-progress --> review
  • Igor Bondarenko - 2014-11-19

    Closed #686.

    + 9aba981...d62cd94 t686_page_size_amends -> ib/7794 (forced update)

  • Dave Brondsema

    Dave Brondsema - 2014-11-19
    • status: review --> closed
  • Dave Brondsema

    Dave Brondsema - 2014-12-01
    • labels: 42cc, sf-1, sf-current --> 42cc, sf-1
  • Dave Brondsema

    Dave Brondsema - 2015-01-05
    • Milestone: unreleased --> asf_release_1.2.0

Log in to post a comment.