Bug 42004 - Checkout history becomes weird after 1000 checkouts on an item
Summary: Checkout history becomes weird after 1000 checkouts on an item
Status: RESOLVED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Baptiste Wojtkowski (bwoj)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-03-05 17:16 UTC by Baptiste Wojtkowski (bwoj)
Modified: 2026-03-05 17:20 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Baptiste Wojtkowski (bwoj) 2026-03-05 17:16:18 UTC
This code from issuehistory.pl looks very weird to me, in particular when you have a timestamp ordered ascendently. A temporary fix waiting for an update of the array would be to order by timestamps descending.

 51 my @old_checkouts = Koha::Old::Checkouts->search(
 52     { biblionumber => $biblionumber },
 53     {
 54         join       => 'item',
 55         order_by   => 'timestamp',
 56         rows       => 1000,
 57     }
 58 )->as_list;

Steps to reproduce :
1 - Add 1000+ checkouts
2 - visit issuehistory.pl -> the last issues are not on top.