When setting up a new Z39.50 target, the Syntax currently defaults to UNIMARC. It would be really helpful to have it default to whatever the system preference marcflavour is set to (UNIMARC or MARC21).
I am wondering if the list of formats is misleading - we have many, but afaict Koha only differentiates USMARC/MARC21 and UNIMARC - and the rest, while part of the Z39.50 spec, are simply ignored? Our code only references them in this script (with some spurious matches in JS for SBN and CCF) git grep "INTERMARC\|UKMARC\|NORMARC\|LIBRISMARC\|DANMARC\|FINMARC\|CANMARC\|PICAMARC\|AUSMARC\|IBERMARC\|CATMARC\|MALMARC" git grep -c "[^IH]SBN" git grep -c "CCF" MARC::Record->new_from_xml seems to only accept 4, and I am not sure it treats USMARC/MARC21 differently: 143 If you have a chunk of XML and you want a record object for it you can use 144 this method to generate a MARC::Record object. You can pass an optional 145 encoding parameter to specify which encoding (UTF-8 or MARC-8) you would like 146 the resulting record to be in. You can also pass a format parameter to specify 147 the source record type, such as UNIMARC, UNIMARCAUTH, USMARC or MARC21.
Pre-selecting the marcflavour format makes a lot of sense, also shortening the list if it has on consequence. How should we migrate existing entries?
So according to https://metacpan.org/pod/MARC::File::XML#MARC::File::XML-%3Edefault_record_format([$format]) the only valid formats are "MARC21, USMARC, UNIMARC and UNIMARCAUTH" In the code for MARC::File::XML, it mostly just checks if it's unimarc or not, and I think there's one test for unimarc vs unimarcauth. So... I think we can probably just change this to "UNIMARC" and "MARC21/USMARC". For migrating... I'd say force to MARC21/USMARC for other formats, since that's what the MARC::* code appears to do anyway.
I just had another report of a library failing to add Z39.50 targets because they accidentally set them up to use UNIMARC instead of USMARC. I'll try to get to this one...