Bug 38102 - Checkout history in OPAC displaying more than 50 items
Summary: Checkout history in OPAC displaying more than 50 items
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 33949
Blocks: 40345
  Show dependency treegraph
 
Reported: 2024-10-04 21:04 UTC by Sara Brown
Modified: 2025-08-01 12:47 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.02,24.11.08
Circulation function:


Attachments
Bug 38102: Fix limit to 50 items in the checkout history - OPAC (1.54 KB, patch)
2025-07-10 08:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38102: Fix default sort order (930 bytes, patch)
2025-07-10 08:02 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 38102: Fix limit to 50 items in the checkout history - OPAC (1.59 KB, patch)
2025-07-17 14:32 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 38102: Fix default sort order (981 bytes, patch)
2025-07-17 14:32 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 38102: Fix limit to 50 items in the checkout history - OPAC (1.65 KB, patch)
2025-07-18 10:57 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 38102: Fix default sort order (1.02 KB, patch)
2025-07-18 10:57 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Sara Brown 2024-10-04 21:04:16 UTC
In the Checkout history tab of the OPAC, the 'Showing last 50 items/how all items' feature isn't working properly in 24.05. If I have a patron with over 50 items, all items are displaying on that tab when 'Showing last 50 items' should be active by default. If I click 'Show all items' to reload the page (which shows, as expected, all items), but then click 'Show last 50 items', I still see all items, not just the first 50.
Comment 1 Jason Robb 2025-06-05 14:00:16 UTC
Still present in 24.11. I have a patron with a rather large checkout history (3,000+ rows) and this bug seems to be preventing the page from loading for them at all.
Comment 2 Owen Leonard 2025-07-08 11:41:37 UTC
The limit number is being passed correctly, but it doesn't seem to be doing anything:

my $checkouts = [
    $patron->checkouts(
        {},
        {
            order_by => $order,
            prefetch => { item => { biblio => 'biblioitems' } },
            ( $limit ? ( limit => $limit ) : () ),
        }
    )->as_list
];
Comment 3 Jonathan Druart 2025-07-10 08:02:11 UTC
Created attachment 183921 [details] [review]
Bug 38102: Fix limit to 50 items in the checkout history - OPAC

Checkout history does not limit to 50 items, it's a regression from bug
33949.

To limit to 50 items we need to use "rows", not "limit".

Test plan:
Have more than 50 checkouts and confirm that by default the table only
displays 50 entries.
Comment 4 Jonathan Druart 2025-07-10 08:02:13 UTC
Created attachment 183922 [details] [review]
Bug 38102: Fix default sort order

DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'date_due desc' in 'order clause' at /kohadevbox/koha/Koha/Objects.pm line 401
Comment 5 Owen Leonard 2025-07-17 14:32:20 UTC
Created attachment 184206 [details] [review]
Bug 38102: Fix limit to 50 items in the checkout history - OPAC

Checkout history does not limit to 50 items, it's a regression from bug
33949.

To limit to 50 items we need to use "rows", not "limit".

Test plan:
Have more than 50 checkouts and confirm that by default the table only
displays 50 entries.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Owen Leonard 2025-07-17 14:32:23 UTC
Created attachment 184207 [details] [review]
Bug 38102: Fix default sort order

DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception:
DBD::mysql::st execute failed: Unknown column 'date_due desc' in 'order
clause' at /kohadevbox/koha/Koha/Objects.pm line 401

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 7 Martin Renvoize (ashimema) 2025-07-18 10:57:33 UTC
Created attachment 184321 [details] [review]
Bug 38102: Fix limit to 50 items in the checkout history - OPAC

Checkout history does not limit to 50 items, it's a regression from bug
33949.

To limit to 50 items we need to use "rows", not "limit".

Test plan:
Have more than 50 checkouts and confirm that by default the table only
displays 50 entries.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 8 Martin Renvoize (ashimema) 2025-07-18 10:57:35 UTC
Created attachment 184322 [details] [review]
Bug 38102: Fix default sort order

DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception:
DBD::mysql::st execute failed: Unknown column 'date_due desc' in 'order
clause' at /kohadevbox/koha/Koha/Objects.pm line 401

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 9 Lucas Gass (lukeg) 2025-07-18 17:11:33 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 10 Paul Derscheid 2025-07-24 08:19:54 UTC
Nice work everyone!

Pushed to 25.05.x
Comment 11 Fridolin Somers 2025-08-01 12:47:38 UTC
Pushed to 24.11.x for 24.11.08