From 4103ef01a877a025b4c1bd44c5439f1b49e3a70a Mon Sep 17 00:00:00 2001 From: Cesar Velez Date: Tue, 8 Aug 2017 16:13:15 -0400 Subject: [PATCH] LP#1624443 - TPAC 500 error after adding duplicate title to Temp List Credit to gmcharlt, prevents the my list (temporary list) page from crashing when a user has added a title to the list more than once. This can happen if they add a title then login, then redo search and add same title. Per Galen, it looks like an issue with OpenSRF::MultiSession parallel record retrieval causing some kind of race condition when there are duplicate entries in the list. Signed-off by: Cesar Velez Signed-off-by: Chris Sharp Signed-off-by: Galen Charlton --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm index 199ff7a900..eb268dc5d2 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Util.pm @@ -3,6 +3,7 @@ use strict; use warnings; use Apache2::Const -compile => qw(OK DECLINED FORBIDDEN HTTP_INTERNAL_SERVER_ERROR REDIRECT HTTP_BAD_REQUEST); use File::Spec; use Time::HiRes qw/time sleep/; +use List::MoreUtils qw/uniq/; use OpenSRF::Utils::Cache; use OpenSRF::Utils::Logger qw/$logger/; use OpenILS::Utils::CStoreEditor qw/:funcs/; @@ -420,7 +421,7 @@ sub get_records_and_facets { $self->timelog("get_records_and_facets(): about to call ". "$unapi_type via json_query (rec_ids has " . scalar(@$rec_ids)); - my @loop_recs = @$rec_ids; + my @loop_recs = uniq @$rec_ids; my %rec_timeout; while (my $bid = shift @loop_recs) { -- 2.11.0