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: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 36473
Blocks: 37775
  Show dependency treegraph
 
Reported: 2024-04-01 15:00 UTC by Nick Clemens (kidclamp)
Modified: 2024-11-04 00:01 UTC (History)
6 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:
24.11.00,24.05.04,23.11.10
Circulation function:


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
Bug 36474: Unit tests (4.56 KB, patch)
2024-08-28 13:29 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 36474: Don't update records when total issues has not changed (3.84 KB, patch)
2024-08-28 13:29 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 36474: Unit tests (4.63 KB, patch)
2024-09-18 04:06 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 36474: Don't update records when total issues has not changed (3.90 KB, patch)
2024-09-18 04:06 UTC, Martin Renvoize (ashimema)
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 (emlam) 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
Comment 6 Nick Clemens (kidclamp) 2024-08-28 13:29:43 UTC
Created attachment 170816 [details] [review]
Bug 36474: Unit tests
Comment 7 Nick Clemens (kidclamp) 2024-08-28 13:29:46 UTC
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>
Comment 8 Martin Renvoize (ashimema) 2024-09-18 04:06:24 UTC
Created attachment 171646 [details] [review]
Bug 36474: Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize (ashimema) 2024-09-18 04:06:27 UTC
Created attachment 171647 [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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2024-09-19 11:35:47 UTC
Thanks for all the hard work!

Pushed to main for the next 24.11.00 release as RM Assistant
Comment 11 Lucas Gass (lukeg) 2024-09-24 15:24:15 UTC
Backported to 24.05.x for upcoming 24.05.04
Comment 12 Fridolin Somers 2024-10-21 12:55:45 UTC
Pushed to 23.11.x for 23.11.10
Comment 13 Wainui Witika-Park 2024-11-04 00:01:57 UTC
Not backporting to 23.05.x unless requested