Bug 36832: (bug 36791 follow-up) Allow authid=0

To test:
1. Go to the Authorities module and do a Z39.50 search that will return
   results (e.g. a general subject heading)
2. Import an authority record from the results
--> Confirm that the record is imported into the editor
3. Authorities > New, replace it via Z39.50, confirm it's imported
4. Authorities > New, fill the required fields, confirm it saves
5. Edit an existing authority, replace it via Z39.50, confirm it saves
6. Edit an existing authority, replace authid=nn in the URL with a
   number that doesn't exist like 1000000, confirm you get a 404 page

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Emily Lamancusa 2024-05-10 14:01:59 -04:00 committed by Katrin Fischer
parent b7a5cc5bee
commit 1aba01adb4
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -553,7 +553,7 @@ if ( $op eq 'cud-change-framework' ) {
my $dbh = C4::Context->dbh;
my $authobj = Koha::Authorities->find($authid);
if ( defined $authid && !$authobj ) {
if ( $authid && !$authobj ) {
print $input->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
exit;
}