From ae1bf932090d2cfeabf3b2f61cafa1bbcda540f2 Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Thu, 2 Jul 2026 14:20:44 -0700 Subject: [PATCH] Bug 42920: Looking up authority records in Advanced editor shouldn't append spaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Lucas Gass --- .../prog/en/modules/authorities/blinddetail-biblio-search.tt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt index 2b95b295ab..bd248415bd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt @@ -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 %]