Bug 26134 - Error when adding to basket from new/staged file when using MARCItemFieldsToOrder
Summary: Error when adding to basket from new/staged file when using MARCItemFieldsToO...
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 23463
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-04 12:29 UTC by Andrew Fuerste-Henry
Modified: 2020-09-20 21:44 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.04


Attachments
Bug 26134: (bug 23463 follow-up) Fix add to basket from staged file (1.39 KB, patch)
2020-08-06 10:52 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 26134: (bug 23463 follow-up) Fix add to basket from staged file (1.46 KB, patch)
2020-08-13 01:51 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 26134: (bug 23463 follow-up) Fix add to basket from staged file (1.51 KB, patch)
2020-08-15 08:05 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Fuerste-Henry 2020-08-04 12:29:58 UTC
To recreate:
- set at least one value in MARCItemFieldsToOrder
- add to a basket via staged file with at least one value matching your MARCItemFields mappings
- set required fields for your order and click Save
- receive error: "DBIx::Class::Storage::DBI::_dbh_execute(): Column 'itemnumber' cannot be null at /kohadevbox/koha/Koha/Acquisition/Order.pm line 113
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77"
Comment 1 Jonathan Druart 2020-08-06 10:50:13 UTC
Caused by
  commit 2075a22ed3c71196002dd8da28a061f791baf393
  Bug 23463: Replace AddItem calls with Koha::Item->store
Comment 2 Jonathan Druart 2020-08-06 10:52:25 UTC
Created attachment 107873 [details] [review]
Bug 26134: (bug 23463 follow-up) Fix add to basket from staged file

There is a ->store call missing when we attempt to create a new item.

Test plan:
- set at least one value in MARCItemFieldsToOrder
- add to a basket via staged file with at least one value matching your MARCItemFields mappings
- set required fields for your order and click Save
=> Without this patch you got:
receive error: "DBIx::Class::Storage::DBI::_dbh_execute(): Column 'itemnumber' cannot be null at /kohadevbox/koha/Koha/Acquisition/Order.pm line 113
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77"
=> With this patch applied the order has been created successfully
Comment 3 Andrew Fuerste-Henry 2020-08-13 01:51:03 UTC
Created attachment 108158 [details] [review]
Bug 26134: (bug 23463 follow-up) Fix add to basket from staged file

There is a ->store call missing when we attempt to create a new item.

Test plan:
- set at least one value in MARCItemFieldsToOrder
- add to a basket via staged file with at least one value matching your MARCItemFields mappings
- set required fields for your order and click Save
=> Without this patch you got:
receive error: "DBIx::Class::Storage::DBI::_dbh_execute(): Column 'itemnumber' cannot be null at /kohadevbox/koha/Koha/Acquisition/Order.pm line 113
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77"
=> With this patch applied the order has been created successfully

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 4 Katrin Fischer 2020-08-15 08:05:38 UTC
Created attachment 108316 [details] [review]
Bug 26134: (bug 23463 follow-up) Fix add to basket from staged file

There is a ->store call missing when we attempt to create a new item.

Test plan:
- set at least one value in MARCItemFieldsToOrder
- add to a basket via staged file with at least one value matching your MARCItemFields mappings
- set required fields for your order and click Save
=> Without this patch you got:
receive error: "DBIx::Class::Storage::DBI::_dbh_execute(): Column 'itemnumber' cannot be null at /kohadevbox/koha/Koha/Acquisition/Order.pm line 113
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77"
=> With this patch applied the order has been created successfully

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2020-08-19 07:36:27 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 6 Lucas Gass 2020-09-04 16:11:27 UTC
backported to 20.05.x for 20.05.04
Comment 7 Aleisha Amohia 2020-09-20 21:42:30 UTC
missing dependencies, not backported to 19.11.x