Bug 15939

Summary: modification logs view now silently defaults to only current day's actions
Product: Koha Reporter: Galen Charlton <gmcharlt>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: brendan, jonathan.druart, julian.maurice, marjorie.barry-vila, mustaqeemabd
Version: MainKeywords: regression
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 13813    
Bug Blocks:    
Attachments: Bug 15939: Action logs - Do not default dates to today
Bug 15939: Action logs - Do not default dates to today
[PASSED QA] Bug 15939: Action logs - Do not default dates to today

Description Galen Charlton 2016-02-29 18:17:16 UTC
When accessing the modification logs from a link that does not explicitly set the to and from dates (e.g., from patron or bib details), no results are displayed unless the object had an action occur during the current day.

This is a side-effect of commit 5dceb851 for bug 13813:

In C4/Log.pm:

-    my $iso_datefrom = C4::Dates->new($datefrom,C4::Context->preference("dateformat"))->output('iso');
-    my $iso_dateto = C4::Dates->new($dateto,C4::Context->preference("dateformat"))->output('iso');
+    my $iso_datefrom = output_pref({ dt => dt_from_string( $datefrom ), dateformat => 'iso', dateonly => 1 });
+    my $iso_dateto = output_pref({ dt => dt_from_string( $dateto ), dateformat => 'iso', dateonly => 1 });

In particular, C4::Dates->new($foo... returns undefined if $foo is undefined, whereas output_pref({ dt => dt_from_string( $foo... returns the current date.

This amounts to a regression.
Comment 1 Jonathan Druart 2016-03-01 11:01:13 UTC Comment hidden (obsolete)
Comment 2 Galen Charlton 2016-03-01 13:47:32 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2016-03-01 22:43:49 UTC
Created attachment 48523 [details] [review]
[PASSED QA] Bug 15939: Action logs - Do not default dates to today

When accessing the modification logs from a link that does not
explicitly set the to and from dates (e.g., from patron or bib details),
no results are displayed unless the object had an action occur during
the current day.

This is a side-effect of commit 5dceb851 for bug 13813.

Test plan:
- View the modification logs of a record which has already been modified
(/tools/viewlog.pl?do_it=1&modules=CATALOGUING&action=MODIFY&object=XXX)
=> Without this patch, you won't see any logs (unless you have modified
the record today)
=> With this patch, the behavior is the same as prior bug 13813 (you can
check in 3.20.x), you will see all logs

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Brendan Gallagher 2016-03-02 00:53:51 UTC
Pushed to Master - Should be in the May 2016 Release. Thanks!
Comment 5 Julian Maurice 2016-03-07 10:35:44 UTC
Patch pushed to 3.22.x, will be in 3.22.5
Comment 6 Jonathan Druart 2016-03-08 11:28:15 UTC
*** Bug 15620 has been marked as a duplicate of this bug. ***