Bug 14932: Do not call can_edit_subscription with an empty value
ref($sub) eq 'ARRAY' should always be true, what we want is to call
can_edit_subscription if there is at least 1 serial for this
subscription.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 17f4b05d23)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This commit is contained in:
parent
061baca088
commit
733d77520f
|
|
@ -343,7 +343,7 @@ sub GetFullSubscription {
|
|||
my $sth = $dbh->prepare($query);
|
||||
$sth->execute($subscriptionid);
|
||||
my $subscriptions = $sth->fetchall_arrayref( {} );
|
||||
my $cannotedit = not can_edit_subscription( $subscriptions->[0] ) if ref($subscriptions) eq 'ARRAY';
|
||||
my $cannotedit = not can_edit_subscription( $subscriptions->[0] ) if scalar @$subscriptions;
|
||||
for my $subscription ( @$subscriptions ) {
|
||||
$subscription->{cannotedit} = $cannotedit;
|
||||
}
|
||||
|
|
@ -503,7 +503,7 @@ sub GetFullSubscriptionsFromBiblionumber {
|
|||
my $sth = $dbh->prepare($query);
|
||||
$sth->execute($biblionumber);
|
||||
my $subscriptions = $sth->fetchall_arrayref( {} );
|
||||
my $cannotedit = not can_edit_subscription( $subscriptions->[0] ) if ref($subscriptions) eq 'ARRAY';
|
||||
my $cannotedit = not can_edit_subscription( $subscriptions->[0] ) if scalar @$subscriptions;
|
||||
for my $subscription ( @$subscriptions ) {
|
||||
$subscription->{cannotedit} = $cannotedit;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue