Bug 40667

Summary: Koha does not sort local cover images the same for for staff/OPAC detail pages
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Lucas Gass (lukeg) 2025-08-18 16:57:49 UTC
In OPAC detail:

$template->param( localimages => $biblio->cover_images );

We get local images in no particular order. 

In Staff detail:

    $template->param(
        localimages =>
            $biblio->cover_images->search( {}, { order_by => [ \"COALESCE(itemnumber, 0, 1)", 'timestamp' ] } ),
    );

We order the images, first by itemnumber and secondary sort on timestamp. 


These should be the same so that the images appear the same in both staff/OPAC.