Bug 36474 - updatetotalissues.pl should not modify the record when the total issues has not changed
Summary: updatetotalissues.pl should not modify the record when the total issues has ...
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
Depends on: 36473
Blocks:
  Show dependency treegraph
 
Reported: 2024-04-01 15:00 UTC by Nick Clemens (kidclamp)
Modified: 2024-04-08 13:37 UTC (History)
2 users (show)

See Also:
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:


Attachments
Bug 36474: Don't update records when total issues has not changed (3.64 KB, patch)
2024-04-01 15:09 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 36474: Don't update records when total issues has not changed (3.68 KB, patch)
2024-04-02 08:44 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2024-04-01 15:00:39 UTC

    
Comment 1 Nick Clemens (kidclamp) 2024-04-01 15:09:29 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
Comment 2 David Nind 2024-04-02 08:44:58 UTC
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>
Comment 3 David Nind 2024-04-02 08:59:22 UTC
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.
Comment 4 Emily Lamancusa 2024-04-04 21:04:15 UTC
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.
Comment 5 Nick Clemens (kidclamp) 2024-04-08 13:37:13 UTC
We are working on adding a unit test here, and adjusting the existing/dependent tests