Bugzilla – Attachment 166328 Details for
Bug 36786
(Bug 31791 follow-up) Koha explodes when trying to edit a bibliographic record with an invalid biblionumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36786: (Bug 31791 follow-up) Koha explodes when trying to edit a biblio with invalid biblionumber
Bug-36786-Bug-31791-follow-up-Koha-explodes-when-t.patch (text/plain), 2.12 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-05-07 18:09:02 UTC
(
hide
)
Description:
Bug 36786: (Bug 31791 follow-up) Koha explodes when trying to edit a biblio with invalid biblionumber
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-05-07 18:09:02 UTC
Size:
2.12 KB
patch
obsolete
>From 20ffd4c378386528fb1792540993d902a9192760 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Mon, 6 May 2024 09:08:50 +0000 >Subject: [PATCH] Bug 36786: (Bug 31791 follow-up) Koha explodes when trying to > edit a biblio with invalid biblionumber > >After changes made to addbiblio with the bug 31791, when trying to open the >editor with biblionumber=<invalid_number> (e.g. a deleted biblionumber) >Koha explodes with a message << Can't call method "can_be_edited" on >an undefined value at /kohadevbox/koha/cataloguing/addbiblio.pl line 555 >> > >Test plan: >========== >1. Try to edit a biblio giving as a biblionumber (in URL) a non-existing > biblionumber, e.g. in ktd, with standard ktd test data: > http://your_ktd:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=1234567 > Koha should explode with the message: > Can't call method "can_be_edited" on an undefined value at > /kohadevbox/koha/cataloguing/addbiblio.pl line 555 >2. Apply the patch; restart_all. >3. Repeat p.1. You should get a page with the info: "The record you are trying > to edit doesn't exist...". > >Sponsored-by: Ignatianum University in Cracow >Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > cataloguing/addbiblio.pl | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 3d92cdad1fb..97ecddd5e53 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -547,15 +547,15 @@ if ($biblionumber) { > > $biblio = Koha::Biblios->find($biblionumber); > >- unless ($biblio) { >+ if ($biblio) { >+ unless ( $biblio->can_be_edited($logged_in_patron) ) { >+ print $input->redirect("/cgi-bin/koha/errors/403.pl"); # escape early >+ exit; >+ } >+ } else { > $biblionumber = undef; > $template->param( bib_doesnt_exist => 1 ); > } >- >- unless ( $biblio->can_be_edited($logged_in_patron) ) { >- print $input->redirect("/cgi-bin/koha/errors/403.pl"); # escape early >- exit; >- } > } > > if ($frameworkcode eq 'FA'){ >-- >2.45.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36786
:
166190
|
166233
|
166260
|
166262
|
166285
| 166328