Bug 12029: Remove 'params' from filter_by_unread
It's not used and not needed, you can chain methods. Also remove unused C4::Koha module and useless statement in tests. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
368dfdc7d0
commit
806cbf8d8c
3 changed files with 1 additions and 6 deletions
|
@ -41,14 +41,11 @@ Koha::Patron::Messages - Koha Message Object set class
|
|||
=cut
|
||||
|
||||
sub filter_by_unread {
|
||||
my ( $self, $params ) = @_;
|
||||
|
||||
$params ||= {};
|
||||
my ( $self ) = @_;
|
||||
|
||||
return $self->search(
|
||||
{
|
||||
patron_read_date => { is => undef },
|
||||
%$params,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
use Modern::Perl;
|
||||
use CGI qw ( -utf8 );
|
||||
use C4::Koha;
|
||||
use C4::Context;
|
||||
use C4::Output qw( output_html_with_http_headers );
|
||||
use C4::Auth qw( get_template_and_user );
|
||||
|
|
|
@ -113,7 +113,6 @@ my $current_messages_count = $patron_obj->messages->count;
|
|||
is( $patron_obj->messages->filter_by_unread->count, $current_messages_count, "No messages have been marked as read" );
|
||||
$new_message_4->update({ patron_read_date => dt_from_string });
|
||||
is( $patron_obj->messages->filter_by_unread->count, $current_messages_count - 1, "One message has been marked as read" );
|
||||
$new_message_4->update({ patron_read_date => undef });
|
||||
|
||||
$schema->storage->txn_rollback;
|
||||
|
||||
|
|
Loading…
Reference in a new issue