From ee8c19ef8e2e5180eea8a9936df2fadc34077057 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 9 Jan 2019 10:59:17 -0500 Subject: [PATCH] JBAS-2169 SCKO holds receipt target sorting repair Ensure the list of hold targets is in the same order as the user data array provided by the caller for printing the holds receipt. This allows the UI to pass the hold status (queue pos, ready-for-pickup) and have the values link to the correct hold when compiling the print template. Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm index a966d7466a..becdadf5e2 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ.pm @@ -1920,6 +1920,18 @@ sub fire_circ_events { return undef unless @$targets; + # KCLS JBAS-2169 -- Alternate fix for LP#1370694 + # Sort targets to match target-id order provided by the caller. + # This guarantees correct user-data / target linking for active + # (i.e. print) hooks. + my @tmp; + for my $id (@$target_ids) { + # circ/hold/usr all have an "id" field. + my ($target) = grep {$_->id == $id} @$targets; + push(@tmp, $target); + } + $targets = \@tmp; + if ($hook eq 'email.selfcheck.checkout') { # KCLS JBAS-1728 # Avoid firing passive email events here. Create the events, -- 2.11.0