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

(-)a/Koha/Patron/Attribute.pm (+4 lines)
Lines 58-63 sub store { Link Here
58
58
59
    Koha::Exceptions::Patron::Attribute::InvalidAttributeValue->throw( attribute => $self )
59
    Koha::Exceptions::Patron::Attribute::InvalidAttributeValue->throw( attribute => $self )
60
        unless $self->value_ok();
60
        unless $self->value_ok();
61
    C4::Context->dbh->do(
62
        "UPDATE borrowers SET updated_on = NOW() WHERE borrowernumber = ?", undef,
63
        $self->borrowernumber
64
    );
61
65
62
    return $self->SUPER::store();
66
    return $self->SUPER::store();
63
}
67
}
(-)a/members/memberentry.pl (-1 lines)
Lines 576-582 if ((!$nok) and $nodouble and ($op eq 'cud-insert' or $op eq 'cud-save')){ Link Here
576
        if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {
576
        if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) {
577
            $patron->extended_attributes->filter_by_branch_limitations->delete;
577
            $patron->extended_attributes->filter_by_branch_limitations->delete;
578
            $patron->extended_attributes($extended_patron_attributes);
578
            $patron->extended_attributes($extended_patron_attributes);
579
            $patron->set( { updated_on => "" } )->store;
580
        }
579
        }
581
580
582
        if ( $destination eq 'circ' and not C4::Auth::haspermission( C4::Context->userenv->{id}, { circulate => 'circulate_remaining_permissions' } ) ) {
581
        if ( $destination eq 'circ' and not C4::Auth::haspermission( C4::Context->userenv->{id}, { circulate => 'circulate_remaining_permissions' } ) ) {
(-)a/t/db_dependent/Koha/Patron/Attribute.t (-2 / +40 lines)
Lines 33-39 my $builder = t::lib::TestBuilder->new; Link Here
33
33
34
subtest 'store() tests' => sub {
34
subtest 'store() tests' => sub {
35
35
36
    plan tests => 5;
36
    plan tests => 6;
37
38
    subtest 'Update an attribute should update the patron "updated_on" field' => sub {
39
40
        plan tests => 1;
41
42
        $schema->storage->txn_begin;
43
44
        my $patron     = $builder->build_object( { class => 'Koha::Patrons' } );
45
        my $updated_on = $patron->updated_on;
46
47
        sleep 1;    # Timestamps are in one second increments, so we need to wait one second
48
49
        my $type = $builder->build_object(
50
            {
51
                class => 'Koha::Patron::Attribute::Types',
52
                value => {
53
                    mandatory     => 0,
54
                    repeatable    => 0,
55
                    unique_id     => 0,
56
                    category_code => undef
57
                }
58
            }
59
        );
60
61
        my $attr = $patron->add_extended_attribute(
62
            {
63
                code      => $type->code,
64
                attribute => 'TEST'
65
            }
66
        );
67
68
        $attr->set( { attribute => 'TEST' } )->store();
69
70
        $patron->discard_changes;
71
72
        isnt( $updated_on, $patron->updated_on, "Updated on was updated by attribute storage" );
73
74
        $schema->storage->txn_rollback;
75
    };
37
76
38
    subtest 'repeatable attributes tests' => sub {
77
    subtest 'repeatable attributes tests' => sub {
39
78
40
- 

Return to bug 35508