From 6dc76c34e0bab6631f1182d8aab557b37997f6dd Mon Sep 17 00:00:00 2001 From: senator Date: Thu, 23 Sep 2010 00:14:03 +0000 Subject: [PATCH] Hopefully fix a holds list sorting issue that only manifested when printing. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17899 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index 22b218860..7dde2ef53 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -1269,10 +1269,18 @@ sub print_hold_pull_list { return undef unless @$hold_ids; $client->status(new OpenSRF::DomainObject::oilsContinueStatus); + # Holds will /NOT/ be in order after this ... my $holds = $e->search_action_hold_request({id => $hold_ids}, {substream => 1}); $client->status(new OpenSRF::DomainObject::oilsContinueStatus); - return $U->fire_object_event(undef, 'ahr.format.pull_list', $holds, $org_id); + # ... so we must resort. + my $hold_map = +{map { $_->id => $_ } @$holds}; + my $sorted_holds = []; + push @$sorted_holds, $hold_map->{$_} foreach @$hold_ids; + + return $U->fire_object_event( + undef, "ahr.format.pull_list", $sorted_holds, $org_id + ); } -- 2.11.0