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

(-)a/C4/Letters.pm (-2 / +2 lines)
Lines 1065-1073 sub SendQueuedMessages { Link Here
1065
    my $unsent_messages = _get_unsent_messages( $which_unsent_messages );
1065
    my $unsent_messages = _get_unsent_messages( $which_unsent_messages );
1066
    MESSAGE: foreach my $message ( @$unsent_messages ) {
1066
    MESSAGE: foreach my $message ( @$unsent_messages ) {
1067
        my $message_object = Koha::Notice::Messages->find( $message->{message_id} );
1067
        my $message_object = Koha::Notice::Messages->find( $message->{message_id} );
1068
        $message_object->status('processing');
1069
        # If this fails the database is unwritable and we won't manage to send a message that continues to be marked 'pending'
1068
        # If this fails the database is unwritable and we won't manage to send a message that continues to be marked 'pending'
1070
        return unless $message_object->store();
1069
        $message_object->make_column_dirty('status');
1070
        return unless $message_object->store;
1071
1071
1072
        # warn Data::Dumper->Dump( [ $message ], [ 'message' ] );
1072
        # warn Data::Dumper->Dump( [ $message ], [ 'message' ] );
1073
        warn sprintf( 'sending %s message to patron: %s',
1073
        warn sprintf( 'sending %s message to patron: %s',
(-)a/Koha/Object.pm (-1 / +1 lines)
Lines 390-396 sub AUTOLOAD { Link Here
390
        }
390
        }
391
    }
391
    }
392
392
393
    my @known_methods = qw( is_changed id in_storage get_column discard_changes update related_resultset );
393
    my @known_methods = qw( is_changed id in_storage get_column discard_changes update related_resultset make_column_dirty );
394
394
395
    Koha::Exceptions::Object::MethodNotCoveredByTests->throw( "The method $method is not covered by tests!" ) unless grep {/^$method$/} @known_methods;
395
    Koha::Exceptions::Object::MethodNotCoveredByTests->throw( "The method $method is not covered by tests!" ) unless grep {/^$method$/} @known_methods;
396
396
(-)a/t/db_dependent/Koha/Object.t (-3 / +11 lines)
Lines 43-50 BEGIN { Link Here
43
my $schema  = Koha::Database->new->schema;
43
my $schema  = Koha::Database->new->schema;
44
my $builder = t::lib::TestBuilder->new();
44
my $builder = t::lib::TestBuilder->new();
45
45
46
subtest 'is_changed' => sub {
46
subtest 'is_changed / make_column_dirty' => sub {
47
    plan tests => 6;
47
    plan tests => 9;
48
48
49
    $schema->storage->txn_begin;
49
    $schema->storage->txn_begin;
50
50
Lines 70-75 subtest 'is_changed' => sub { Link Here
70
    $object->store();
70
    $object->store();
71
    is( $object->is_changed(), 0, "Object no longer marked as changed after being stored" );
71
    is( $object->is_changed(), 0, "Object no longer marked as changed after being stored" );
72
72
73
    # Test make_column_dirty
74
    $object->make_column_dirty('firstname');
75
    is( $object->is_changed, 1, "Object is changed after make dirty" );
76
    $object->store;
77
    is( $object->is_changed, 0, "Store clears dirty mark" );
78
    $object->make_column_dirty('firstname');
79
    $object->discard_changes;
80
    is( $object->is_changed, 0, "Discard clears dirty mark too" );
81
73
    $schema->storage->txn_rollback;
82
    $schema->storage->txn_rollback;
74
};
83
};
75
84
76
- 

Return to bug 18725