[Bug 30939] New: remove_unused_authorities.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Bug ID: 30939 Summary: remove_unused_authorities.pl Change sponsored?: --- Product: Koha Version: 22.05 Hardware: All OS: Linux Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: biblioteca@agustinosvalladolid.org QA Contact: testopia@bugs.koha-community.org When I try to remove unused authorithies I get: authid=1 type=PERSO_NAME : used 6 time(s) authid=2 type=TOPIC_TERM : used 23 time(s) authid=3 type=PERSO_NAME : used 3 time(s) authid=4 type=PERSO_NAMEUndefined subroutine &main::DelAuthority called at /usr/share/koha/bin/migration_tools/remove_unused_authorities.pl line 98. When I try only a test works OK. Thank you Fernando -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|remove_unused_authorities.p |remove_unused_authorities.p |l |l is broken Severity|enhancement |major Version|22.05 |master --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Confirmed on maser with the sample database: authid=172 type=CORPO_NAME : used 2 time(s) authid=173 type=PERSO_NAMEUndefined subroutine &main::DelAuthority called at ./misc/migration_tools/remove_unused_authorities.pl line 98. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |katrin.fischer@bsz-bw.de |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 136320 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136320&action=edit Bug 30939: Fix use statement for DelAuthority Without this patch, the script won't delete any unused authorities, but gives an error instead and dies: Undefined subroutine &main::DelAuthority called at ./misc/migration_tools/remove_unused_authorities.pl line 98. To test: - Run from koha-shell: ./misc/migration_tools/remove_unused_authorities.pl -t - Verify several authorities are reported as unused - ./misc/migration_tools/remove_unused_authorities.pl -c - Verify the error message is shown when the first unused authority is found and the script stops - Apply patch and rerun: ./misc/migration_tools/remove_unused_authorities.pl -t - Verify the error is gone, the script finishes and auhorities are deleted https://bugs.koha-community.org/show_bug.cgi?id=30936 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136320|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 136323 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136323&action=edit Bug 30939: Fix use statement for DelAuthority Without this patch, the script won't delete any unused authorities, but gives an error instead and dies: Undefined subroutine &main::DelAuthority called at ./misc/migration_tools/remove_unused_authorities.pl line 98. To test: - Run from koha-shell: ./misc/migration_tools/remove_unused_authorities.pl -t - Verify several authorities are reported as unused - ./misc/migration_tools/remove_unused_authorities.pl -c - Verify the error message is shown when the first unused authority is found and the script stops - Apply patch and rerun: ./misc/migration_tools/remove_unused_authorities.pl -t - Verify the error is gone, the script finishes and auhorities are deleted https://bugs.koha-community.org/show_bug.cgi?id=30936 Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Text to go in the| |This fixes the release notes| |./misc/migration_tools/remo | |ve_unused_authorities.pl | |script so that it now works | |and deletes unused | |authority records. Before | |this, it generated an error | |message at the first unused | |authority record and | |stopped (without deleting | |any unused authority | |records). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136323|0 |1 is obsolete| | --- Comment #4 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 136661 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136661&action=edit Bug 30939: Fix use statement for DelAuthority Without this patch, the script won't delete any unused authorities, but gives an error instead and dies: Undefined subroutine &main::DelAuthority called at ./misc/migration_tools/remove_unused_authorities.pl line 98. To test: - Run from koha-shell: ./misc/migration_tools/remove_unused_authorities.pl -t - Verify several authorities are reported as unused - ./misc/migration_tools/remove_unused_authorities.pl -c - Verify the error message is shown when the first unused authority is found and the script stops - Apply patch and rerun: ./misc/migration_tools/remove_unused_authorities.pl -t - Verify the error is gone, the script finishes and auhorities are deleted https://bugs.koha-community.org/show_bug.cgi?id=30936 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |fridolin.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |fridolin.somers@biblibre.co |y.org |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 --- Comment #5 from Fridolin Somers <fridolin.somers@biblibre.com> --- How could be search for thoses ? I try : git grep 'use C4::.*;' | egrep -v '^(C4|Koha|t)/' | egrep -v 'qw ?(\(|/)' | grep -v Context If found for example : tools/batch_delete_records.pl:use C4::AuthoritiesMarc; Is it a correct match ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |17600 CC| |tomascohen@gmail.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17600 [Bug 17600] Standardize the EXPORT -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Fridolin Somers from comment #5)
How could be search for thoses ?
I try : git grep 'use C4::.*;' | egrep -v '^(C4|Koha|t)/' | egrep -v 'qw ?(\(|/)' | grep -v Context
If found for example : tools/batch_delete_records.pl:use C4::AuthoritiesMarc;
Is it a correct match ?
Nope. Because the script is using fully-qualified method names (e.g. C4::AuthoritiesMarc::GetAuthority( $record_id ) ) so not importing the function names into the package scope is not a real issue. We need to check that C4::AuthoritiesMarc defines a method that is used in a script. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |lucas@bywatersolutions.com Version(s)|22.11.00 |22.11.00, 22.05.04 released in| | --- Comment #8 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for 22.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com Status|Pushed to stable |Pushed to oldstable Version(s)|22.11.00, 22.05.04 |22.11.00, 22.05.04, released in| |21.11.11 --- Comment #9 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- applied to 21.11.x for 21.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30939 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |victor@tuxayo.net Status|Pushed to oldstable |RESOLVED --- Comment #10 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Missing dependencies for 21.05.x, it shouldn't be affected, no backport. Nothing to document, marking resolved. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org