Bug 37272

Summary: Show only matching rules options for the type of record being imported in the MARC staging tool
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: CatalogingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: m.de.rooy, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Caroline Cyr La Rose 2024-07-08 15:31:58 UTC
When staging MARC records for import, the form asks what type of records are being imported. When creating a matching rule, the form asks what type of records are being matched. However, when staging authority records for example, all the matching rules are displayed in the drop-down menu. I think it would be cleaner and easier to only show the matching rules for the type of record being imported.

To recreate:
1. Create a matching rule for bibliographic records, if you don't already have one
   1.1. Go to Administration > Record matching rules
   1.2. Click New record matching rule
   1.3. Fill out the form, making sure to use bibliographic type and bibliographic indexes
        - Code: ISBN
        - Description: 020$a
        - Match threshold: 1000
        - Record type: Bibliographic record
        - Match point 1
          - Search index: isbn
          - Score: 1000
          - Tag: 020
          - Subfield: a
          - Normalization rule: ISBN
   1.4. Click Save

2. Create a matching rule for authority records, if you don't already have one
   2.1. Go to Administration > Record matching rules
   2.2. Click New record matching rule   
   2.3. Fill out the form, making sure to use authority type and authority indexes
        - Code: HEADING
        - Description: Authority headings
        - Match threshold: 100
        - Record type: Authority record
        - Match point 1
          - Search index: heading-main
          - Score: 100
          - Tag: 100
          - Subfield: a
   2.4. Click Save

3. Go to Cataloging > Stage records for import
4. Click Choose file and choose a file (doesn't matter the file, we just need the rest of the form to be displayed)
5. Click Upload file
6. Choose Record type: Bibliographic
7. Check the matching rules
   --> All the matching rules are there, including the authority rules
8. Change the record type to Authority
9. Check the matching rules
   --> All the matching rules are there, including the bibliographic rules