Browse Source

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

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
19.05.x
Jonathan Druart 5 years ago
committed by Nick Clemens
parent
commit
f45fe692b1
  1. 4
      serials/subscription-add.pl

4
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} );
}
@ -465,7 +465,7 @@ sub redirect_mod_subscription {
my $skip_serialseq = $query->param('skip_serialseq');
my $mana_id;
if ( defined( $query->param('mana_id') ) ) {
if ( $query->param('mana_id') ne "" ) {
$mana_id = $query->param('mana_id');
Koha::SharedContent::increment_entity_value("subscription",$mana_id, "nbofusers");
}

Loading…
Cancel
Save