Bugzilla – Attachment 126311 Details for
Bug 29243
PrepareItemrecordDisplay should not be called with empty string in defaultvalues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29243: Correct call when adding items from staged records
Bug-29243-Correct-call-when-adding-items-from-stag.patch (text/plain), 2.33 KB, created by
Martin Renvoize (ashimema)
on 2021-10-15 08:35:04 UTC
(
hide
)
Description:
Bug 29243: Correct call when adding items from staged records
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-10-15 08:35:04 UTC
Size:
2.33 KB
patch
obsolete
>From 7009a934bf3473f07b5fe461ed7426a4ad4788fd Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 14 Oct 2021 11:30:21 +0000 >Subject: [PATCH] Bug 29243: Correct call when adding items from staged records > >To test: >1 - Populate system preference NewItemsDefaultLocation >2 - Stage a file of marc records >3 - Create an acquisitions basket with 'AcqCreateItems' set to 'ordering' >4 - Attempt to add to basket from your staged file >5 - You get a 500 error, and in the logs: > Can't use string ("") as a HASH ref while "strict refs" in use at /usr/share/koha/lib/C4/Items.pm line 1605. >6 - Apply patch >7 - Repeat #4 >8 - Success! > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Items.pm | 4 +++- > acqui/addorderiso2709.pl | 4 ++-- > 2 files changed, 5 insertions(+), 3 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 1fa72d21c2..9ee3bcd01a 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1525,10 +1525,12 @@ sub _find_value { > > =head2 PrepareItemrecordDisplay > >- PrepareItemrecordDisplay($itemrecord,$bibnum,$itemumber,$frameworkcode); >+ PrepareItemrecordDisplay($bibnum,$itemumber,$defaultvalues,$frameworkcode); > > Returns a hash with all the fields for Display a given item data in a template > >+$defaultvalues should either contain a hashref of values for the new item, or be undefined. >+ > The $frameworkcode returns the item for the given frameworkcode, ONLY if bibnum is not provided > > =cut >diff --git a/acqui/addorderiso2709.pl b/acqui/addorderiso2709.pl >index 404c3334bd..1f758a3065 100755 >--- a/acqui/addorderiso2709.pl >+++ b/acqui/addorderiso2709.pl >@@ -108,11 +108,11 @@ if ($op eq ""){ > import_biblios_list($template, $cgiparams->{'import_batch_id'}); > if ( $basket->effective_create_items eq 'ordering' && !$basket->is_standing ) { > # prepare empty item form >- my $cell = PrepareItemrecordDisplay( '', '', '', 'ACQ' ); >+ my $cell = PrepareItemrecordDisplay( '', '', undef, 'ACQ' ); > > # warn "==> ".Data::Dumper::Dumper($cell); > unless ($cell) { >- $cell = PrepareItemrecordDisplay( '', '', '', '' ); >+ $cell = PrepareItemrecordDisplay( '', '', undef, '' ); > $template->param( 'NoACQframework' => 1 ); > } > my @itemloop; >-- >2.20.1
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 29243
:
126271
|
126297
| 126311