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

(-)a/C4/SIP/Sip.pm (-1 / +4 lines)
Lines 108-114 sub maybe_add { Link Here
108
            $value =~ s/$regex->{find}/$regex->{replace}/g;
108
            $value =~ s/$regex->{find}/$regex->{replace}/g;
109
        }
109
        }
110
    }
110
    }
111
    return (defined($value) && $value) ? add_field($fid, $value) : '';
111
112
    return ( defined($value) && length($value) )
113
      ? add_field( $fid, $value )
114
      : '';
112
}
115
}
113
116
114
#
117
#
(-)a/t/db_dependent/SIP/Message.t (-2 / +4 lines)
Lines 115-121 subtest 'Test hold_patron_bcode' => sub { Link Here
115
115
116
subtest 'hold_patron_name() tests' => sub {
116
subtest 'hold_patron_name() tests' => sub {
117
117
118
    plan tests => 2;
118
    plan tests => 3;
119
119
120
    my $schema = Koha::Database->new->schema;
120
    my $schema = Koha::Database->new->schema;
121
    $schema->storage->txn_begin;
121
    $schema->storage->txn_begin;
Lines 145-150 subtest 'hold_patron_name() tests' => sub { Link Here
145
    my $resp = C4::SIP::Sip::maybe_add( FID_CALL_NUMBER, $sip_item->hold_patron_name, $server );
145
    my $resp = C4::SIP::Sip::maybe_add( FID_CALL_NUMBER, $sip_item->hold_patron_name, $server );
146
    is( $resp, q{}, "maybe_add returns empty string for SIP item with no hold returns empty string" );
146
    is( $resp, q{}, "maybe_add returns empty string for SIP item with no hold returns empty string" );
147
147
148
    $resp = C4::SIP::Sip::maybe_add( FID_CALL_NUMBER, "0", $server );
149
    is( $resp, q{CS0|}, "maybe_add will create the field of the string '0'" );
150
148
    $schema->storage->txn_rollback;
151
    $schema->storage->txn_rollback;
149
};
152
};
150
153
151
- 

Return to bug 31202