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

(-)a/Koha/Exceptions/Patron/Attribute.pm (-2 / +2 lines)
Lines 32-45 sub full_message { Link Here
32
    unless ( $msg) {
32
    unless ( $msg) {
33
        if ( $self->isa('Koha::Exceptions::Patron::Attribute::NonRepeatable') ) {
33
        if ( $self->isa('Koha::Exceptions::Patron::Attribute::NonRepeatable') ) {
34
            $msg = sprintf(
34
            $msg = sprintf(
35
                "Tried to add more than one non-repeatable attributes. code=%s attribute=%s",
35
                "Tried to add more than one non-repeatable attributes. type=%s value=%s",
36
                $self->attribute->code,
36
                $self->attribute->code,
37
                $self->attribute->attribute
37
                $self->attribute->attribute
38
            );
38
            );
39
        }
39
        }
40
        elsif ( $self->isa('Koha::Exceptions::Patron::Attribute::UniqueIDConstraint') ) {
40
        elsif ( $self->isa('Koha::Exceptions::Patron::Attribute::UniqueIDConstraint') ) {
41
            $msg = sprintf(
41
            $msg = sprintf(
42
                "Your action breaks a unique constraint on the attribute. code=%s attribute=%s",
42
                "Your action breaks a unique constraint on the attribute. type=%s value=%s",
43
                $self->attribute->code,
43
                $self->attribute->code,
44
                $self->attribute->attribute
44
                $self->attribute->attribute
45
            );
45
            );
(-)a/t/Koha/Exceptions.t (-2 / +2 lines)
Lines 220-226 subtest 'Koha::Exceptions::Patron::Attribute::* tests' => sub { Link Here
220
    # stringify the exception
220
    # stringify the exception
221
    is(
221
    is(
222
        "$@",
222
        "$@",
223
        "Tried to add more than one non-repeatable attributes. code=$code attribute=$attribute",
223
        "Tried to add more than one non-repeatable attributes. type=$code value=$attribute",
224
        'Exception stringified correctly'
224
        'Exception stringified correctly'
225
    );
225
    );
226
226
Lines 244-250 subtest 'Koha::Exceptions::Patron::Attribute::* tests' => sub { Link Here
244
    # stringify the exception
244
    # stringify the exception
245
    is(
245
    is(
246
        "$@",
246
        "$@",
247
        "Your action breaks a unique constraint on the attribute. code=$code attribute=$attribute",
247
        "Your action breaks a unique constraint on the attribute. type=$code value=$attribute",
248
        'Exception stringified correctly'
248
        'Exception stringified correctly'
249
    );
249
    );
250
250
(-)a/t/db_dependent/Koha/Patron/Attribute.t (-5 / +4 lines)
Lines 91-99 subtest 'store() tests' => sub { Link Here
91
91
92
        is(
92
        is(
93
            "$@",
93
            "$@",
94
            "Tried to add more than one non-repeatable attributes. code="
94
            "Tried to add more than one non-repeatable attributes. type="
95
            . $attribute_type_2->{code}
95
            . $attribute_type_2->{code}
96
            . " attribute=Bar",
96
            . " value=Bar",
97
            'Exception stringified correctly, attribute passed correctly'
97
            'Exception stringified correctly, attribute passed correctly'
98
        );
98
        );
99
99
Lines 164-172 subtest 'store() tests' => sub { Link Here
164
164
165
        is(
165
        is(
166
            "$@",
166
            "$@",
167
            "Your action breaks a unique constraint on the attribute. code="
167
            "Your action breaks a unique constraint on the attribute. type="
168
            . $attribute_type_2->{code}
168
            . $attribute_type_2->{code}
169
            . " attribute=Foo",
169
            . " value=Foo",
170
            'Exception stringified correctly, attribute passed correctly'
170
            'Exception stringified correctly, attribute passed correctly'
171
        );
171
        );
172
172
173
- 

Return to bug 27858