Bug 38200 - Remove dead code to delete authorities in authorities/authorities.pl
Summary: Remove dead code to delete authorities in authorities/authorities.pl
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Phil Ringnalda
QA Contact: Jonathan Druart
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-18 03:11 UTC by Phil Ringnalda
Modified: 2024-12-18 20:26 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06
Circulation function:


Attachments
Bug 38200: Remove dead code to delete authorities in authorities/authorities.pl (2.78 KB, patch)
2024-10-18 03:31 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 38200: Remove dead code to delete authorities in authorities/authorities.pl (2.84 KB, patch)
2024-10-22 15:39 UTC, Yanjun Li
Details | Diff | Splinter Review
Bug 38200: Remove dead code to delete authorities in authorities/authorities.pl (2.88 KB, patch)
2024-10-23 08:04 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Ringnalda 2024-10-18 03:11:07 UTC
authorities/authorities.pl (the authority editor) has an op cud-delete.

Hypothetically, it might have been run at some point before the template transition 13 years ago: somewhere between the initial commit of authorities support 20 years ago and then, the editor might have had a delete button that called it. Since then, it hasn't had one.

You can see that it hasn't been run in the past 8 years by looking at the use block: before 8 years ago we had use C4::AuthoritiesMarc; but since then we've used specific exported things from it, never including DelAuthority.

You might think it was used by deleting authorities in auth_finder.pl, a rather odd thing to have, but no: from the start, when it was auth_linker.pl, it has not had UI to delete.

It did have the param nonav which it used to send people back to auth_linker after they created an authority, but since it was also passing myindex, the index of the bib field where auth_linker was supposed to put the results of its lookup, now the existence of that says it's an authority created from auth_finder and nonav is dead, too.
Comment 1 Phil Ringnalda 2024-10-18 03:31:08 UTC
Created attachment 172940 [details] [review]
Bug 38200: Remove dead code to delete authorities in authorities/authorities.pl

It has probably never been used. There's no sign of any UI to delete from
the authority editor or auth_finder in the last 13 years of templates, and
it was unused when it landed; the patch that actually made the first patch
work, a month later, put deleting authorities in authorities_home.pl, where
it has been ever since.

It certainly hasn't been used since bug 17600 landed in 2021, since it
doesn't 'use C4::AuthoritiesMarc qw( DelAuthority );' and so if you try to
use it you just get an error for your trouble.

Sponsored-by: Chetco Community Public Library
Comment 2 Yanjun Li 2024-10-22 15:39:33 UTC
Created attachment 173171 [details] [review]
Bug 38200: Remove dead code to delete authorities in authorities/authorities.pl

It has probably never been used. There's no sign of any UI to delete from
the authority editor or auth_finder in the last 13 years of templates, and
it was unused when it landed; the patch that actually made the first patch
work, a month later, put deleting authorities in authorities_home.pl, where
it has been ever since.

It certainly hasn't been used since bug 17600 landed in 2021, since it
doesn't 'use C4::AuthoritiesMarc qw( DelAuthority );' and so if you try to
use it you just get an error for your trouble.

Sponsored-by: Chetco Community Public Library
Signed-off-by: Yanjun Li <yanjun.li@bywatersolutions.com>
Comment 3 Jonathan Druart 2024-10-23 08:04:26 UTC
Created attachment 173193 [details] [review]
Bug 38200: Remove dead code to delete authorities in authorities/authorities.pl

It has probably never been used. There's no sign of any UI to delete from
the authority editor or auth_finder in the last 13 years of templates, and
it was unused when it landed; the patch that actually made the first patch
work, a month later, put deleting authorities in authorities_home.pl, where
it has been ever since.

It certainly hasn't been used since bug 17600 landed in 2021, since it
doesn't 'use C4::AuthoritiesMarc qw( DelAuthority );' and so if you try to
use it you just get an error for your trouble.

Sponsored-by: Chetco Community Public Library
Signed-off-by: Yanjun Li <yanjun.li@bywatersolutions.com>

Amended-by: Jonathan Druart
tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Katrin Fischer 2024-10-23 17:19:00 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 5 Lucas Gass (lukeg) 2024-11-20 18:37:24 UTC
Backported to 24.05.x for upcoming 24.05.06
Comment 6 Fridolin Somers 2024-12-13 14:58:26 UTC
I prefer not backport to 23.11.x for stability
Comment 7 Phil Ringnalda 2024-12-18 20:26:39 UTC
Removes code which has never done anything, nothing to document.