Bug 26337 - Remove unused authorities script should skip merge
Summary: Remove unused authorities script should skip merge
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Josef Moravec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-01 13:29 UTC by Nick Clemens
Modified: 2021-12-13 21:09 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.07


Attachments
Bug 26337: Pass skip_merge to DelAuthority when removing unsused authorities (1.58 KB, patch)
2020-09-01 13:37 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 26337: Pass skip_merge to DelAuthority when removing unsused authorities (1.63 KB, patch)
2020-11-05 05:33 UTC, David Nind
Details | Diff | Splinter Review
Bug 26337: Pass skip_merge to DelAuthority when removing unsused authorities (1.68 KB, patch)
2020-11-17 16:56 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2020-09-01 13:29:21 UTC
Remove unused authorities checks if an authority is used

If not it calls DelAuthority

DelAuthority checks if the authority is used and removes it from records if it is.

We should pass 'skip_merge' when calling form this script as we have already checked the usage here
Comment 1 Nick Clemens 2020-09-01 13:37:05 UTC
Created attachment 109431 [details] [review]
Bug 26337: Pass skip_merge to DelAuthority when removing unsused authorities

This script checks that an authority is not being used before deleting it.
We do not need to check biblios for the authority id as we have already verified it is unused.

TO test:
 1 - Reset db to koha test database
 2 - perl misc/migration_tools/remove_unused_authorities.pl -t
 3 - Note a number of unsued authorities
 4 - perl misc/migration_tools/remove_unused_authorities.pl -c
 5 - Note authorities are removed
 6 - Reset db
 7 - Apply patch
 8 - perl misc/migration_tools/remove_unused_authorities.pl -t
 9 - Note results are the same
10 - perl misc/migration_tools/remove_unused_authorities.pl -c
11 - Note results are the same
Comment 2 David Nind 2020-11-05 05:33:19 UTC
Created attachment 113030 [details] [review]
Bug 26337: Pass skip_merge to DelAuthority when removing unsused authorities

This script checks that an authority is not being used before deleting it.
We do not need to check biblios for the authority id as we have already verified it is unused.

TO test:
 1 - Reset db to koha test database
 2 - perl misc/migration_tools/remove_unused_authorities.pl -t
 3 - Note a number of unsued authorities
 4 - perl misc/migration_tools/remove_unused_authorities.pl -c
 5 - Note authorities are removed
 6 - Reset db
 7 - Apply patch
 8 - perl misc/migration_tools/remove_unused_authorities.pl -t
 9 - Note results are the same
10 - perl misc/migration_tools/remove_unused_authorities.pl -c
11 - Note results are the same

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2020-11-05 05:34:09 UTC
Results from running through the test plan.

Before patch applied
====================

perl misc/migration_tools/remove_unused_authorities.pl -t

  1706 authorities parsed
  493 can be deleted because unused
  1213 unchanged because used

perl misc/migration_tools/remove_unused_authorities.pl -c

  1706 authorities parsed
  493 deleted because unused
  1213 unchanged because used

After patch applied
===================

perl misc/migration_tools/remove_unused_authorities.pl -t

  1706 authorities parsed
  493 can be deleted because unused
  1213 unchanged because used

perl misc/migration_tools/remove_unused_authorities.pl -c

  1706 authorities parsed
  493 deleted because unused
  1213 unchanged because used
Comment 4 Josef Moravec 2020-11-17 16:56:41 UTC
Created attachment 113745 [details] [review]
Bug 26337: Pass skip_merge to DelAuthority when removing unsused authorities

This script checks that an authority is not being used before deleting it.
We do not need to check biblios for the authority id as we have already verified it is unused.

TO test:
 1 - Reset db to koha test database
 2 - perl misc/migration_tools/remove_unused_authorities.pl -t
 3 - Note a number of unsued authorities
 4 - perl misc/migration_tools/remove_unused_authorities.pl -c
 5 - Note authorities are removed
 6 - Reset db
 7 - Apply patch
 8 - perl misc/migration_tools/remove_unused_authorities.pl -t
 9 - Note results are the same
10 - perl misc/migration_tools/remove_unused_authorities.pl -c
11 - Note results are the same

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 5 Jonathan Druart 2020-11-18 11:04:06 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 6 Andrew Fuerste-Henry 2020-12-09 20:59:11 UTC
Pushed to 20.05.x for 20.05.07
Comment 7 Victor Grousset/tuxayo 2020-12-10 14:35:30 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.