From 4f531c88ae012796e59f576d1aa94f5a323b1800 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 6 Feb 2019 15:03:01 +0100 Subject: [PATCH] Bug 22140: Use of EasyAnalyticalRecords pref is get_hostitemnumbers_of Like Bug 20702 defined GetHostItemsInfo does nothing if EasyAnalyticalRecords pref is disabled, get_hostitemnumbers_of must be dependant on this pref too. Test plan : 1) Build an analytical record with 773$0 and $9 2) Enable EasyAnalyticalRecords 4) Place an hold on the record 5) => You see the linked item 6) Disable EasyAnalyticalRecords 7) Place an hold on the record 8) => You dont see the linked item Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens (cherry picked from commit 12fe392d26fda1559f5690a71330a93ffc72a6b7) Signed-off-by: Martin Renvoize --- C4/Items.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/C4/Items.pm b/C4/Items.pm index f2ab215b3a..cd67f6deaa 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1199,8 +1199,12 @@ references on array of itemnumbers. sub get_hostitemnumbers_of { my ($biblionumber) = @_; - my $marcrecord = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber }); + if( !C4::Context->preference('EasyAnalyticalRecords') ) { + return (); + } + + my $marcrecord = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber }); return unless $marcrecord; my ( @returnhostitemnumbers, $tag, $biblio_s, $item_s ); -- 2.39.5