From 2d330ae2d40145fe8ea68726b418553bfb03b5be Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sat, 4 May 2019 12:33:34 -0400 Subject: [PATCH] Bug 22849: Do not share data (Mana) without agreement A couple of things wrong in serials/subscription-add.pl 1. 447 if ( defined( $query->param('mana_id') ) ) { It's always defined, you wanted to test with "" 2. 375 if ( (C4::Context->preference('Mana')) and ( grep { $_ eq "subscription" } split(/,/, C4::Context->preference('AutoShareWithMana'))) ){ Mana == 2 == let me think about it => I am not expecting to reach Koha::SharedContent in that case So we are sharing data whereas the library did not decide yet! Test plan: You need to be familiar you Mana to test this patch. JD: I did not test this patch --- serials/subscription-add.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serials/subscription-add.pl b/serials/subscription-add.pl index 9e503e55ae..11456dc859 100755 --- a/serials/subscription-add.pl +++ b/serials/subscription-add.pl @@ -377,7 +377,7 @@ sub redirect_add_subscription { $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq, $itemtype, $previousitemtype, $mana_id ); - if ( (C4::Context->preference('Mana')) and ( grep { $_ eq "subscription" } split(/,/, C4::Context->preference('AutoShareWithMana'))) ){ + if ( (C4::Context->preference('Mana') == 1) and ( grep { $_ eq "subscription" } split(/,/, C4::Context->preference('AutoShareWithMana'))) ){ my $result = Koha::SharedContent::send_entity( $query->param('mana_language') || '', $loggedinuser, $subscriptionid, 'subscription'); $template->param( mana_msg => $result->{msg} ); } -- 2.11.0