Bug 22363 updated the log viewer from using C4::Logs::GetLogs to Koha::ActionLogs->search, however, GetLogs appended wildcards to the search and viewlogs.pl does not
Created attachment 106415 [details] [review] Bug 25893: Use wildcards when searching logs The restores the wildcards that were used in the past I also clean up a few warns and unused param To test: 0 - Ensure cataloguing logs and issues logs are enabled 1 - Edit an item 2 - Circulate that same item 3 - Browse to tools-> log viewer 4 - Put the itemnumber in the 'info' box 5 - You see only the circulation 6 - Put the itemnumber in the object box 7 - You see only the cataloging modification 8 - Apply patch 9 - Put itemnumber in info box 10 - you see both actions 11 - Put the itemnumber in the object box 12 - You see only the catalogiong modification
Created attachment 106433 [details] [review] Bug 25893: Use wildcards when searching logs The restores the wildcards that were used in the past I also clean up a few warns and unused param To test: 0 - Ensure cataloguing logs and issues logs are enabled 1 - Edit an item 2 - Circulate that same item 3 - Browse to tools-> log viewer 4 - Put the itemnumber in the 'info' box 5 - You see only the circulation 6 - Put the itemnumber in the object box 7 - You see only the cataloging modification 8 - Apply patch 9 - Put itemnumber in info box 10 - you see both actions 11 - Put the itemnumber in the object box 12 - You see only the catalogiong modification Signed-off-by: Jason Robb <jrobb@sekls.org>
The patch works as intended. However, using a wildcard on object (which is an identifier) does not seem to be a good idea, since you will retrieve many unwanted results. Moreover, the wildcard in C4::Logs::GetLogs was only on info, and not on object: if ($object) { $query .= " AND object = ? "; push( @parameters, $object ); } Hence, it doesn't restore the old behavior, but changes it. What do you think?
Created attachment 106602 [details] [review] Bug 25893: Don't wildcard object
(In reply to Matthias Meusburger from comment #3) > The patch works as intended. > > However, using a wildcard on object (which is an identifier) does not seem > to be a good idea, since you will retrieve many unwanted results. > > Moreover, the wildcard in C4::Logs::GetLogs was only on info, and not on > object: > > if ($object) { > $query .= " AND object = ? "; > push( @parameters, $object ); > } > > Hence, it doesn't restore the old behavior, but changes it. > > What do you think? Yup, I just got mixed up, removed wildcards from object
I think a better example for why this is useful is searching for system preference changes. Like put any pref in info to see when it was toggled and to which settings. It doesn't work without this patch.
Created attachment 106891 [details] [review] Bug 25893: Don't wildcard object Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 107084 [details] [review] Bug 25893: Use wildcards when searching logs The restores the wildcards that were used in the past I also clean up a few warns and unused param To test: 0 - Ensure cataloguing logs and issues logs are enabled 1 - Edit an item 2 - Circulate that same item 3 - Browse to tools-> log viewer 4 - Put the itemnumber in the 'info' box 5 - You see only the circulation 6 - Put the itemnumber in the object box 7 - You see only the cataloging modification 8 - Apply patch 9 - Put itemnumber in info box 10 - you see both actions 11 - Put the itemnumber in the object box 12 - You see only the catalogiong modification Signed-off-by: Jason Robb <jrobb@sekls.org> Bug 25893: Don't wildcard object Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Patches squashed
The removal of enabled_staff_search_views is not correct. koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt 316 [% INCLUDE 'biblio-view-menu.inc' %] Usually it's not a good idea to embed unrelated changes ;)
Created attachment 107802 [details] [review] Bug 25893: Use wildcards when searching logs The restores the wildcards that were used in the past To test: 0 - Ensure cataloguing logs and issues logs are enabled 1 - Edit an item 2 - Circulate that same item 3 - Browse to tools-> log viewer 4 - Put the itemnumber in the 'info' box 5 - You see only the circulation 6 - Put the itemnumber in the object box 7 - You see only the cataloging modification 8 - Apply patch 9 - Put itemnumber in info box 10 - you see both actions 11 - Put the itemnumber in the object box 12 - You see only the catalogiong modification Signed-off-by: Jason Robb <jrobb@sekls.org> Bug 25893: Don't wildcard object Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 107803 [details] [review] Bug 25893: (follow-up) Undo unrelated changes
Created attachment 107869 [details] [review] Bug 25893: Use wildcards when searching logs The restores the wildcards that were used in the past To test: 0 - Ensure cataloguing logs and issues logs are enabled 1 - Edit an item 2 - Circulate that same item 3 - Browse to tools-> log viewer 4 - Put the itemnumber in the 'info' box 5 - You see only the circulation 6 - Put the itemnumber in the object box 7 - You see only the cataloging modification 8 - Apply patch 9 - Put itemnumber in info box 10 - you see both actions 11 - Put the itemnumber in the object box 12 - You see only the catalogiong modification Signed-off-by: Jason Robb <jrobb@sekls.org> Bug 25893: Don't wildcard object Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Bug 25893: (follow-up) Undo unrelated changes
Pushed to master for 20.11, thanks to everybody involved!
backported to 20.05.x for 20.05.03
backported to 19.11.x for 19.11.09
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.