From c5761a913e0f84517fe442245cc7f912cb3014c4 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 --- C4/Items.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/C4/Items.pm b/C4/Items.pm index 0f75cb1b20..2cd9fc959f 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.11.0