| Summary: | NewOrder does not return ordernumber | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
| Component: | Acquisitions | Assignee: | Jonathan Druart <jonathan.druart> |
| Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
| Severity: | critical | ||
| Priority: | P5 - low | CC: | dpavlin, tomascohen |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 |
| Patch complexity: | Small patch | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: | Circulation function: | ||
| 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
Created attachment 31470 [details] [review] 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. Created attachment 31492 [details] [review] 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> Thanks, this fixes regression. 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. Patch pushed to master. Thanks Jonathan! |