Skip to content

Commit

Permalink
BWS-PKG - Bug 29243: Correct call when adding items from staged records
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
kidclamp authored and kylemhall committed Oct 14, 2021
1 parent 2a5766b commit 1571511
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion C4/Items.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1578,10 +1578,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
Expand Down
4 changes: 2 additions & 2 deletions acqui/addorderiso2709.pl
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@
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;
Expand Down

0 comments on commit 1571511

Please sign in to comment.