Bugzilla – Attachment 148611 Details for
Bug 12029
Patrons should be able to delete their patron messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12029: Remove 'params' from filter_by_unread
Bug-12029-Remove-params-from-filterbyunread.patch (text/plain), 2.14 KB, created by
Jonathan Druart
on 2023-03-23 13:02:08 UTC
(
hide
)
Description:
Bug 12029: Remove 'params' from filter_by_unread
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-03-23 13:02:08 UTC
Size:
2.14 KB
patch
obsolete
>From a75bf29360b71ec8257cfab1cba6a878fad94898 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 23 Mar 2023 12:28:31 +0100 >Subject: [PATCH] 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> >--- > Koha/Patron/Messages.pm | 5 +---- > opac/opac-dismiss-message.pl | 1 - > t/db_dependent/Koha/Patron/Messages.t | 1 - > 3 files changed, 1 insertion(+), 6 deletions(-) > >diff --git a/Koha/Patron/Messages.pm b/Koha/Patron/Messages.pm >index 063c70364b2..a9064772879 100644 >--- a/Koha/Patron/Messages.pm >+++ b/Koha/Patron/Messages.pm >@@ -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, > } > ); > } >diff --git a/opac/opac-dismiss-message.pl b/opac/opac-dismiss-message.pl >index 84c5906b6ac..789825c0359 100755 >--- a/opac/opac-dismiss-message.pl >+++ b/opac/opac-dismiss-message.pl >@@ -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 ); >diff --git a/t/db_dependent/Koha/Patron/Messages.t b/t/db_dependent/Koha/Patron/Messages.t >index 69a4bb428b7..31f8cf92b44 100755 >--- a/t/db_dependent/Koha/Patron/Messages.t >+++ b/t/db_dependent/Koha/Patron/Messages.t >@@ -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; > >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12029
:
130514
|
130515
|
130516
|
132918
|
132949
|
137434
|
137435
|
137518
|
137519
|
137520
|
137521
|
137522
|
137523
|
137646
|
137647
|
137648
|
146706
|
146707
|
146708
|
146709
|
147521
|
147522
|
147523
|
147524
|
147525
|
148607
|
148608
|
148609
|
148610
| 148611