Bug 12891

Summary: NewOrder does not return ordernumber
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: critical    
Priority: P5 - low CC: dpavlin, tomascohen
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Who signed the patch off: Text to go in the release notes:
Version(s) released in:
Bug Depends on: 12626    
Bug Blocks: 12827    
Attachments: Bug 12891: NewOrder does not return ordernumber if ordernumber is defined
Bug 12891: NewOrder does not return ordernumber if ordernumber is defined
[PASSED QA] Bug 12891: NewOrder does not return ordernumber if ordernumber is defined

Description Jonathan Druart 2014-09-08 18:23:54 UTC

    
Comment 1 Jonathan Druart 2014-09-08 18:30:28 UTC Comment hidden (obsolete)
Comment 2 Dobrica Pavlinusic 2014-09-09 14:46:55 UTC Comment hidden (obsolete)
Comment 3 Dobrica Pavlinusic 2014-09-09 14:48:48 UTC
Thanks, this fixes regression.
Comment 4 Katrin Fischer 2014-09-10 21:06:12 UTC
Created attachment 31515 [details] [review]
[PASSED QA] Bug 12891: NewOrder does not return ordernumber if ordernumber is defined

The behavior is quite weird, but
  $schema->resultset('Table')->create($data)->id
does not return the id inserted if $data contains the key.

To be more clear, in this case
  $schema->resultset('Aqorder')->create($new_order)->id
returns an empty string because $new_order->{ordernumber} is an empty
string!

This was not caught by the unit tests, I added one.

Test plan:
- AcqCreateItem set to ordering
- Create an order with items and verify items are correctly linked to the
  order.

Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Confirmed that without the patch the created item is not linked to the
order (entry in aqorders_items). With the patch, it works as expected.
Passes tests and Koha QA script.
Comment 5 Tomás Cohen Arazi 2014-09-18 00:36:57 UTC
Patch pushed to master.

Thanks Jonathan!