Bug 37234

Summary: Order of subfields when there are multiple of a same subfield
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: MARC Authority data supportAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: philippe.blouin
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-02 15:52:22 UTC
Bug 22666 fixed the order of the subfields when using an authority record in a bibliographic record. There is a case when this still doesn't work: if the authority record has multiples of a subfield, but not together. Take the following authority

Music--Social aspects--Asia--History.

it goes $a $x $z $x (notice the two x separated by the z).

When this is copied in a bibliographic record, it is copied as 

Music -- Social aspects -- History -- Asia.

$a $x $x $z; the two x were brought together. 

To recreate:
1. Go to Authorities
2. Click on New authority > Topical term
3. Fill out the mandatory fields (000, 003, 005, 008, 040$a)
4. Click on tab 1
5. Click on 150 - HEADING - TOPICAL TERM
6. Fill out the field
   - a: Music
   - x: Social aspects
   - z: Asia
7. Click on the icon to double the x subfield
8. Type in History
9. Move the History subfield at the end, under Asia
10. Click Save
11. Go to Cataloging > New record
12. Click on tab 6
13. Click on the Tag editor icon next to 650$a
14. In "Search main heading:" type music social
15. Click Choose next to Music Social aspects Asia History
    --> It is copied in the bibliographic record as Music Social aspects **History Asia** (instead of Music Social aspects **Asia History**)