Summary: | updatetotalissues.pl should not modify the record when the total issues has not changed | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Architecture, internals, and plumbing | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | Signed Off --- | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | david, emily.lamancusa |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36013 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This updates the misc/cronjobs/update_totalissues.pl script so that records are only modified if the number of issues changes. Previously, every record was modified - even if the number of issues did not change.
In addition, with CataloguingLog enabled, this previously added one entry to the log viewer for every record - as all the records were modified even if the number of issues did not change. Now, only records where the number of issues have changed are included in the log viewer, significantly reducing the number of entries.
|
Version(s) released in: | |
Circulation function: | |||
Bug Depends on: | 36473 | ||
Bug Blocks: | 37775 | ||
Attachments: |
Bug 36474: Don't update records when total issues has not changed
Bug 36474: Don't update records when total issues has not changed Bug 36474: Unit tests Bug 36474: Don't update records when total issues has not changed |
Description
Nick Clemens (kidclamp)
2024-04-01 15:00:39 UTC
Created attachment 164198 [details] [review] Bug 36474: Don't update records when total issues has not changed This patch adds a new check in UpdateTotalIssues to check that we are changing the number of total issues before calling ModBiblio To test: 0 - Enable CataloguingLog 1 - Checkout an item 2 - Run : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v 3 - In report, note all biblios were updated 4 - Check action_logs - note a new entry for every biblio 5 - Apply patch 6 - Repeat 7 - Note no biblios reported updated 8 - Note no new cataloguing log entries 9 - Checkout the item again 10 - Run again 11 - Note biblionumber has updated count in verbose output 12 - Note report only rpeort 1 biblio modified, the rest only processed 13 - Only one line added to action_logs 14 - Run it again 15 - Confirm no updates Created attachment 164241 [details] [review] Bug 36474: Don't update records when total issues has not changed This patch adds a new check in UpdateTotalIssues to check that we are changing the number of total issues before calling ModBiblio To test: 0 - Enable CataloguingLog 1 - Checkout an item 2 - Run : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v 3 - In report, note all biblios were updated 4 - Check action_logs - note a new entry for every biblio 5 - Apply patch 6 - Repeat 7 - Note no biblios reported updated 8 - Note no new cataloguing log entries 9 - Checkout the item again 10 - Run again 11 - Note biblionumber has updated count in verbose output 12 - Note report only rpeort 1 biblio modified, the rest only processed 13 - Only one line added to action_logs 14 - Run it again 15 - Confirm no updates Signed-off-by: David Nind <david@davidnind.com> Testing notes (using KTD): 1. Before the patch was applied, I had to delete record 369 (as it had encoding issues) so that the script would complete running correctly, and for entries to show in the log viewer. This changes the output of a routine in a .pm file without making any changes to unit tests. As it stands, it fails the subtest that was added in bug 36479. Setting this to BLOCKED for now, since it makes sense to wait until the dependent bug is PQA before making the follow-up changes to the tests. We are working on adding a unit test here, and adjusting the existing/dependent tests Created attachment 170816 [details] [review] Bug 36474: Unit tests Created attachment 170817 [details] [review] Bug 36474: Don't update records when total issues has not changed This patch adds a new check in UpdateTotalIssues to check that we are changing the number of total issues before calling ModBiblio To test: 0 - Enable CataloguingLog 1 - Checkout an item 2 - Run : misc/cronjobs/update_totalissues.pl --use-stats --commit=1000 -v 3 - In report, note all biblios were updated 4 - Check action_logs - note a new entry for every biblio 5 - Apply patch 6 - Repeat 7 - Note no biblios reported updated 8 - Note no new cataloguing log entries 9 - Checkout the item again 10 - Run again 11 - Note biblionumber has updated count in verbose output 12 - Note report only rpeort 1 biblio modified, the rest only processed 13 - Only one line added to action_logs 14 - Run it again 15 - Confirm no updates Signed-off-by: David Nind <david@davidnind.com> |