Bug 38757 - Adding order from a staged file - "Some required subfields are unset"
Summary: Adding order from a staged file - "Some required subfields are unset"
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-19 20:33 UTC by Emily Lamancusa (emlam)
Modified: 2025-05-09 13:53 UTC (History)
6 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
MARC record (1.10 KB, application/marc)
2025-02-10 16:26 UTC, Caroline Cyr La Rose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emily Lamancusa (emlam) 2024-12-19 20:33:46 UTC
When ordering from a staged file that contains item data, we have the option to edit or confirm the individual items on the "Select to import" tab, or import all items with identical information from the "Item information" tab.

When importing individualized item data from the "Select to import" tab, clicking Save triggers an error: "Some required subfields are unset". Setting the Koha item type in the "Item information" tab fixes this error - but it shouldn't be necessary to set the item type in that tab if all items in the "Select to import" tab already have an item type specified.

To replicate:
1. Go to Acquisitions and find or open a basket
2. Click Add to basket
3. Click Add from new file
4. Upload a MARC file containing item data
5. When the upload completes, click "Add to basket"
6. In the "Select to import" tab that comes up by default, check the checkbox next to
   one or more titles in the file
--> This will expand the item data for those titles
7. Look over the item data, and confirm that all items have a homebranch,
   holdingbranch, and item type defined
8. Click "Save"
--> An error pops up: "Some required subfields are unset"
9. Navigate to the "Item information" tab
10. Select a value for y - Koha item type
11. Click "Save" again
--> The orders are imported successfully
Comment 1 Caroline Cyr La Rose 2025-02-10 16:25:42 UTC
I noticed that after that, the item type is still NULL and causes a whole slew of problems with the API later on.

To recreate:
1. Go to Acquisitions
2. Click 'Search' under 'Search vendors'
3. Click 'Add to basket' next to 'My basket'
4. Click 'From a new file'
5. Choose a MARC file
6. Click 'Upload file'
7. Click 'Stage for import'
8. Click 'Add staged files to basket'
9. Click 'Default accounting details'
10. Select a fund
11. Click 'Item information'
12. Choose an item type in 'y - Koha item type'
13. Click 'Select to import'
14. Select the record
15. Enter a price
16. Click 'Save'
17. Click the title to access the bibliographic record
--> API error

If you look in the db, the itemtype is NULL
MariaDB [koha_kohadev]> select itype from items where biblionumber = 439;
+-------+
| itype |
+-------+
| NULL  |
+-------+
1 row in set (0.000 sec)

18. Go back to the basket
19. Click 'Close basket'
20. Click 'Yes, close (Y)'
21. Click 'Receive shipments'
22. Enter a vendor invoice number
23. Click 'Next'
--> API error
Comment 2 Caroline Cyr La Rose 2025-02-10 16:26:42 UTC
Created attachment 177703 [details]
MARC record

The MARC record I used to test. It has no item information in it.
Comment 3 Caroline Cyr La Rose 2025-02-10 16:28:19 UTC
Upping the severity to blocker since we can't do anything with items created this way, even if the user themself does everything right.
Comment 4 Nick Clemens (kidclamp) 2025-03-11 16:21:38 UTC
I think Caroline's comments are bug 39282 - Emily is describing the need to set an item type when the items already have one, Caroline is encountering that when you do define item information in the second tab it isn't being used
Comment 5 Martin Renvoize (ashimema) 2025-05-09 13:53:59 UTC
Given Nicks comment, I'm bringing this back down