Bug 39412 - Ordering from staged records with item tags does not remove item tags
Summary: Ordering from staged records with item tags does not remove item tags
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: 2025-03-21 16:33 UTC by Nick Clemens (kidclamp)
Modified: 2025-04-01 14:39 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2025-03-21 16:33:51 UTC
To recreate:
1 - Export some records from Koha
2 - Set MarcItemFieldsToOrder:

homebranch: 952$a
holdingbranch: 952$b
loc: 952$c
price: 952$g|952$v
itype: 952$y

3 - Stage your exported files for import - don't match and don't check for items
4 - Add to basket from the staged file
5 - Disable matching when adding orders
6 - Save the orders
7 - View the MARC of the new records from the interface
8 - Note marc has 952 fields
9 - You can view in the database in the biblio_metadata table as well:

SELECT biblionumber, ExtractValue(metadata, 'count(//datafield[@tag="952"]/subfield[@code="9"])' ) AS counter
FROM biblio_metadata 
WHERE ExtractValue(metadata, 'count(//datafield[@tag="952"]/subfield[@code="a"])' ) > 0 AND ExtractValue(metadata, '//datafield[@tag="952"]/subfield[@code="9"]' )=''
Comment 1 Caroline Cyr La Rose 2025-04-01 14:39:21 UTC
I'm unable to recreate this (was trying to test bug 39413). I feel like I'm following the test plan but maybe I'm missing a step?? Here's what I do

1. Export records from Koha
   1.1. Go to Cataloging > Export catalog data
   1.2. Fill out the form
        - From biblionumber: 1
        - To biblionumber: 10
        - Item type: All
        - With items owned by the following libraries: Select all
   1.3. Click 'Export bibliographic records'

2. Set MarcItemFieldsToOrder
   2.1. Go to Administration > System preferences
   2.2. Search for MarcItemFieldsToOrder
   2.3. Click 'Edit'
   2.4. Paste the values

homebranch: 952$a
holdingbranch: 952$b
loc: 952$c
price: 952$g|952$v
itype: 952$y

   2.5. Click 'Save all Acquisition preferences'

3. Stage records for import
   3.1. Go to Cataloging > Stage records for import
   3.2. Click 'Browse' and choose the file downloaded in step 1
   3.3. Click 'Upload file'
   3.4. Fill out the form
        - Check for embedded item record data: No
   3.5. Click 'Stage for import'

4. Add to basket from a staged file
   4.1. Go to Acquisitions
   4.2. Click 'Search' next to the vendor search
   4.3. Click 'Add to basket' next to 'My basket'
   4.4. Click 'From a staged file'
   4.5. Click 'Add orders'
   4.6. Click 'Default accounting details'
   4.7. Choose a fund
   4.8. Click 'Item information'
   4.9. Choose an item type
   4.10. Click 'Select to import'
   4.11. Under 'Matching' choose 'Do not look for matching records'
   4.12. Click 'Select all'
   4.13. Click 'Save'

5. View the MARC of the new record
   5.1. Click on one of the titles in the basket
   5.2. Click 'MARC'
   5.3. Click '9'
   ---> No 952

   5.4. In the database, run the report

SELECT biblionumber, ExtractValue(metadata, 'count(//datafield[@tag="952"]/subfield[@code="9"])' ) AS counter FROM biblio_metadata  WHERE ExtractValue(metadata, 'count(//datafield[@tag="952"]/subfield[@code="a"])' ) > 0 AND ExtractValue(metadata, '//datafield[@tag="952"]/subfield[@code="9"]' )='';

   --> Empty set


At first I also tried with adding to basket from new file instead of stashed file, with the same result...