If Tools > Log Viewer is selected and run using the module "Circulation" with the action of "Renew" no results are shown. Selecting the action of "All" shows all results including renewals. The reason appears to be because when selecting the action of "Renew" the form POST uses the action parameter value of "RENEW". This, in turn, gets passed to GetLogs where is used in the SQL query. However, the actual value that is logged in the action_logs table is "RENEWAL" and not "RENEW". Changing the SQL query to "RENEWAL" obtains the correct results. RENEW is correct for the MEMBERS module but RENEWAL should be used for Circ.
The problem is that we have membership renewals that log with RENEW and item renewals that log as RENEWAL, trying to work out a fix.
Created attachment 87486 [details] [review] Bug 22069: Make log viewer find item renewals Without this patch renewals for checkouts wouldn't show in the log viewer. The log viewre was using RENEW, which we use for patrons, but for issue RENEWAL is used. The patch adds RENEWAL to the search params, when Circulation and Renew are selected in the form. To test: - Make sure you have RenewalLog turned on - Make a patron renewal - Check something out and renew it - Go to Tools > Log viewer and test different searches - Modules All - Actions All - Modules All - Actions Renew - Modules Circulation - Actions Renew ... - Make sure results show as expected
Hello, I tested the patch, and he doesn't work. When I tested the different searches, - Modules All - Actions All works - Modules All - Actions Renew return No log found - Modules All - Actions Renew return No log found because you forgot parentheses around the grep: if ( (grep { $_ eq 'CIRCULATION'} @modules) && (grep { $_ eq 'RENEW'} @actions) ) { push @actions, 'RENEWAL'; } But i tkink a better solution will be to change the value in the form: In the actions label replace <option value="RENEW">Renew</option> by <option value="RENEWAL">Renew</option> and the patch will work.
(In reply to axel from comment #3) > Hello, > I tested the patch, and he doesn't work. > When I tested the different searches, > - Modules All - Actions All works > - Modules All - Actions Renew return No log found > > - Modules Circulation - Actions Renew return No log found > because you forgot parentheses around the grep: > > if ( (grep { $_ eq 'CIRCULATION'} @modules) && (grep { $_ eq 'RENEW'} > @actions) ) { > push @actions, 'RENEWAL'; > } > > > But i tkink a better solution will be to change the value in the form: > > In the actions label > replace <option value="RENEW">Renew</option> > by <option value="RENEWAL">Renew</option> > > and the patch will work. When you add the parentheses, this will only resolve the research "- Modules Circulation - Actions Renew" I encourage you to apply the last solution because all the case will works
Axel, it sadly won't work because then you won't be able to find Membership renewals - Module Patrons > Renw.
We have both in the database, RENEW and RENEWAL for different modules.
Created attachment 87645 [details] [review] Bug 22069: Make log viewer find item renewals Without this patch renewals for checkouts wouldn't show in the log viewer. The log viewre was using RENEW, which we use for patrons, but for issue RENEWAL is used. The patch adds RENEWAL to the search params, when Circulation and Renew are selected in the form. To test: - Make sure you have RenewalLog turned on - Make a patron renewal - Check something out and renew it - Go to Tools > Log viewer and test different searches - Modules All - Actions All - Modules All - Actions Renew - Modules Circulation - Actions Renew ... - Make sure results show as expected
Created attachment 87646 [details] [review] Bug 22069: (QA Follow-up) Fix other cases Same test plan as original patch. :)
Created attachment 87647 [details] [review] Bug 22069: Make log viewer find item renewals Without this patch renewals for checkouts wouldn't show in the log viewer. The log viewre was using RENEW, which we use for patrons, but for issue RENEWAL is used. The patch adds RENEWAL to the search params, when Circulation and Renew are selected in the form. To test: - Make sure you have RenewalLog turned on - Make a patron renewal - Check something out and renew it - Go to Tools > Log viewer and test different searches - Modules All - Actions All - Modules All - Actions Renew - Modules Circulation - Actions Renew ... - Make sure results show as expected Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Created attachment 87648 [details] [review] Bug 22069: Make log viewer find item renewals Without this patch renewals for checkouts wouldn't show in the log viewer. The log viewre was using RENEW, which we use for patrons, but for issue RENEWAL is used. The patch adds RENEWAL to the search params, when Renew was selected in the form, so both terms are included in the query. To test: - Make sure you have RenewalLog turned on - Make a patron renewal - Check something out and renew it - Go to Tools > Log viewer and test different searches - Modules All - Actions All - Modules All - Actions Renew - Modules Circulation - Actions Renew ... - Make sure results show as expected
I've changed the patch slightly, thx for testing! I've also added a code comment to make things clearer.
Created attachment 87649 [details] [review] Bug 22069: Make log viewer find item renewals Without this patch renewals for checkouts wouldn't show in the log viewer. The log viewre was using RENEW, which we use for patrons, but for issue RENEWAL is used. The patch adds RENEWAL to the search params, when Renew was selected in the form, so both terms are included in the query. To test: - Make sure you have RenewalLog turned on - Make a patron renewal - Check something out and renew it - Go to Tools > Log viewer and test different searches - Modules All - Actions All - Modules All - Actions Renew - Modules Circulation - Actions Renew ... - Make sure results show as expected Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Created attachment 87958 [details] [review] Bug 22069: Make log viewer find item renewals Without this patch renewals for checkouts wouldn't show in the log viewer. The log viewre was using RENEW, which we use for patrons, but for issue RENEWAL is used. The patch adds RENEWAL to the search params, when Renew was selected in the form, so both terms are included in the query. To test: - Make sure you have RenewalLog turned on - Make a patron renewal - Check something out and renew it - Go to Tools > Log viewer and test different searches - Modules All - Actions All - Modules All - Actions Renew - Modules Circulation - Actions Renew ... - Make sure results show as expected Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Awesome work all! Pushed to master for 19.05
Re-implemented for 18.11.x series as we don't have the refactor that took place in bug 22363. Pushed to 18.11.x for 18.11.05
not backporting to 18.05.x