Bugzilla – Attachment 140694 Details for
Bug 31154
Batch item modification fails when "Use default values" is checked
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31154: Pass biblionumber to Koha::UI::Form::Builder::Item->new from batchMod.pl to prevent error 500
Bug-31154-Pass-biblionumber-to-KohaUIFormBuilderIt.patch (text/plain), 1.94 KB, created by
Marcel de Rooy
on 2022-09-16 09:19:40 UTC
(
hide
)
Description:
Bug 31154: Pass biblionumber to Koha::UI::Form::Builder::Item->new from batchMod.pl to prevent error 500
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-09-16 09:19:40 UTC
Size:
1.94 KB
patch
obsolete
>From 6ed879531946ead17863ec0999c897308bec40c1 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Tue, 26 Jul 2022 13:18:43 +0300 >Subject: [PATCH] Bug 31154: Pass biblionumber to > Koha::UI::Form::Builder::Item->new from batchMod.pl to prevent error 500 >Content-Type: text/plain; charset=utf-8 > >When one tries to batch mod items and has "Use default values" >checkbox checked on and they have value in syspref "itemcallnumber", >Koha dies on error 500. In logs it reads: > >Can't call method "field" on an undefined value at >.../Koha/Koha/UI/Form/Builder/Item.pm line 164. > >This happens because in batchMod.pl line 269 we don't pass >biblionumber as parameter to Koha::UI::Form::Builder::Item->new >and thus Koha fails to fetch biblios marc record. > >To test: >1. Confirm you have/set value to syspref "itemcallnumber" e.g. 084a >2. Find some item(s) to modify >3. Provide barcodes of those item(s) and check checkbox "Use default values" >4. Hit "Continue" >=> error 500 is raised >5. Apply patch. >6. Repeat steps 3. and 4. >=> no error is raised > >Sponsored-by: Koha-Suomi Oy > >Signed-off-by: David Nind <david@davidnind.com> >--- > tools/batchMod.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 2d19a40bf2..fc5ba81a5c 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -265,7 +265,9 @@ if ($op eq "show"){ > # Getting list of subfields to keep when restricted batchmod edit is enabled > my @subfields_to_allow = $restrictededition ? split ' ', C4::Context->preference('SubfieldsToAllowForRestrictedBatchmod') : (); > >- my $subfields = Koha::UI::Form::Builder::Item->new->edit_form( >+ $biblionumber = Koha::Items->find($itemnumbers[0])->unblessed->{biblionumber} if $itemnumbers[0]; >+ my $subfields = Koha::UI::Form::Builder::Item->new( >+ { biblionumber => $biblionumber } )->edit_form( > { > restricted_editition => $restrictededition, > ( >-- >2.30.2
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 31154
:
138124
|
140518
|
140602
| 140694 |
140695
|
141973
|
141974
|
142051
|
142052