Bug 10088 - software error when filling a basket with staged record
Summary: software error when filling a basket with staged record
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P1 - high critical (vote)
Assignee: Jonathan Druart
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-21 18:08 UTC by mathieu saby
Modified: 2019-06-27 09:24 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10088: FIX adding an order from a staged file. (1.43 KB, patch)
2013-04-25 07:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
[PATCH][SIGNED OFF] Bug 10088: FIX adding an order from a staged file. (1.51 KB, patch)
2013-04-25 12:46 UTC, mathieu saby
Details | Diff | Splinter Review
Bug 10088: FIX adding an order from a staged file. (1.58 KB, patch)
2013-04-27 12:01 UTC, Mason James
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description mathieu saby 2013-04-21 18:08:55 UTC
in current master, I staged a file of records, and tried to use it to create orders in a basket.

I got the following error : 

http://pro.koha-msaby/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=18&basketno=21&booksellerid=1

'Can't use string ("") as a HASH ref while "strict refs" in use at /home/msaby/kohamaster/src/C4/Items.pm line 2712.'

Git blame says this line was changed the 27th of march, by commit 9f2189d0, created by bug 9902.

line 2712 : $defaultvalue = $defaultvalues->{branchcode} || C4::Context->userenv->{branch};

M. Saby
Comment 1 mathieu saby 2013-04-21 18:36:32 UTC
line 129 of addorderiso2709.pl call PrepareItemrecordDisplay this way
        my $cell = PrepareItemrecordDisplay( '', '', '', 'ACQ' );

I suppose this is not correct.

M. Saby
Comment 2 Jonathan Druart 2013-04-25 07:52:12 UTC Comment hidden (obsolete)
Comment 3 mathieu saby 2013-04-25 12:46:09 UTC Comment hidden (obsolete)
Comment 4 Mason James 2013-04-27 12:01:36 UTC
Created attachment 17750 [details] [review]
Bug 10088: FIX adding an order from a staged file.

Bug 9902 introduced an issue in the C4::Items::PrepareItemrecordDisplay
routine. The existence of $defaulvalue hashref should be tested before
getting to the branchcode key.

Test plan:
Before applying the patch, an error occurred when you try to create an
order from a staged file.
After applying the patch, the error does not appear anymore.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Mason James <mtj@kohaaloha.com>
Comment 5 Mason James 2013-04-27 12:03:15 UTC
> Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
> Signed-off-by: Mason James <mtj@kohaaloha.com>

passing QA, patch works well!
Comment 6 Jared Camins-Esakov 2013-04-27 12:24:10 UTC
This patch has been pushed to master and 3.12.x.

I was not able to recreate this problem, but the logic is demonstrably correct, so I am pushing it anyway.
Comment 7 Chris Cormack 2013-04-27 22:24:32 UTC
Bug 9902 is not in 3.10.x so this is not needed
Comment 8 Bernardo Gonzalez Kriegel 2013-08-03 20:12:49 UTC
Bug 9902 in now on 3.10.x, so we need this.

Pushed to 3.10.x, will be in 3.10.10
Comment 9 Chris Hall 2013-08-18 04:31:53 UTC
Pushed to 3.8.x, will be in 3.8.17