https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38088

            Bug ID: 38088
           Summary: Incorrect patron name for first patron in
                    pendigreserves list.
 Change sponsored?: ---
           Product: Koha
           Version: 24.05
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P5 - low
         Component: Circulation
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected], [email protected]

It was pointed out to me that the patron name of the first patron in the table
on the pendingreserves page is sometimes wrong.

I am reviewing circ/pendigreserves.pl and the below code seems incorrect to me.
The hash reference holds_biblios_map is only used for the list of biblionumbers
in the query to produce all_holds, which suggest that the where and join
clauses should simply be applied direcly on the query for all_holds.  Also, the
order_by on the first query will have no effect as it is the order of the
second query that counts.

my $holds_biblios_map = {
    map { $_->{biblionumber} => $_->{reserve_id} } @{ Koha::Holds->search(
            {%where},
            {
                join    => ['itembib', 'biblio'],
                select  => ['me.biblionumber', 'me.reserve_id'],
                order_by => { -desc => 'priority' }
            }
        )->unblessed
    }
};

my $all_holds = {
    map { $_->biblionumber => $_ } @{ Koha::Holds->search(
            { reserve_id => [ values %$holds_biblios_map ]},
            {
                prefetch => [ 'borrowernumber', 'itembib', 'biblio',
'item_group' ],
            }
        )->as_list
    }
};

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to