View | Details | Raw Unified | Return to bug 31856
Collapse All | Expand All

(-)a/C4/Serials.pm (-10 / +15 lines)
Lines 643-658 sub SearchSubscriptions { Link Here
643
    for my $subscription ( @$results ) {
643
    for my $subscription ( @$results ) {
644
        $subscription->{cannotedit} = not can_edit_subscription( $subscription );
644
        $subscription->{cannotedit} = not can_edit_subscription( $subscription );
645
        $subscription->{cannotdisplay} = not can_show_subscription( $subscription );
645
        $subscription->{cannotdisplay} = not can_show_subscription( $subscription );
646
        my @additional_field_values = Koha::AdditionalFieldValues->search(
647
            {
648
                field_id => { -in => [ keys %additional_fields_by_id ] },
649
                record_id => $subscription->{subscriptionid}
650
            }
651
        )->as_list;
652
646
653
        $subscription->{additional_fields} = {
647
        if (%additional_fields_by_id) {
654
            map { $additional_fields_by_id{$_->field_id} => $_->value } @additional_field_values
648
            my @additional_field_values = Koha::AdditionalFieldValues->search(
655
        };
649
                {
650
                    field_id => { -in => [ keys %additional_fields_by_id ] },
651
                    record_id => $subscription->{subscriptionid}
652
                }
653
            )->as_list;
654
655
            $subscription->{additional_fields} = {
656
                map { $additional_fields_by_id{$_->field_id} => $_->value } @additional_field_values
657
            };
658
        }
659
        else {
660
            $subscription->{additional_fields} = {};
661
        }
656
    }
662
    }
657
663
658
    return wantarray ? @{$results} : { results => $results, total => $total_results };
664
    return wantarray ? @{$results} : { results => $results, total => $total_results };
659
- 

Return to bug 31856