Bug 42920: Looking up authority records in Advanced editor shouldn't append spaces

The patch for bug 21453 replaced an Advanced editor-specific (in the "[% IF rancor %]" block) "[%- END -%]‡9[% authid | html %]";" which trims whitespace with several lines of  "[% ... %]" which do not trim whitespace. The result is that when you look up an authority from the Advanced editor, you get extra whitespace between the last subfield from the authority record and the $9 field with the authority id.

Test plan:
 1. Without the patch, set the preference EnableAdvancedCatalogingEditor to Enable
 2. Cataloging - Advanced editor
 3. Click in any line of the editor and press Return to get a blank line
 4. Type 655 and press Tab three times
 5. Type Ctrl+Shift+L to open the authority search popup
 6. Click Search (no need for search terms) and click Choose for any record
 7. Note that the editor shows twenty blank spaces between the end of the subfield a
    contents and the ‡9
 8. Apply patch
 9. Repeat steps 3-6, note that now there is no extra space between the end of the
    content and the ‡9

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Phil Ringnalda 2026-07-02 14:20:44 -07:00 committed by Lucas Gass
parent 70f00783c0
commit ae1bf93209
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 1 additions and 4 deletions

View File

@ -40,10 +40,7 @@
[%- FOREACH marc_value IN SUBFIELD_LOO.marc_values -%]
[%- To.json( marc_value ) | html -%]
[%- END -%]
[%- END -%]
[% IF ( marcflavour == 'UNIMARC' ) %]‡3[% authid | html %]";
[% ELSIF ( marcflavour == 'MARC21' ) %]‡9[% authid | html %]";
[% END %]
[%- END -%]‡9[% authid | html %]";
[% END %]
RancorReplaceField( new_line, "[% indicator1 | html %]", "[% indicator2 | html %]" );
[% ELSE %]