Bug 30174 - Unable to get rancor/advanced cataloguing editor to print equals sign ('=') from macros
Summary: Unable to get rancor/advanced cataloguing editor to print equals sign ('=') f...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 21.05
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-23 23:36 UTC by Carlos Lopez
Modified: 2022-02-26 13:10 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Lopez 2022-02-23 23:36:48 UTC
On Rancor/Advanced Cataloguing Editor we cannot add a macro that prints an equals sign ('=') to a MARC tag. 

For example, we have a macro that looks like this
'''
new 856=‡zClick here to access book online‡uhttps://proxy.dml.vic.edu.au/login?url
indicators=40
'''
but we need to then manually add an equals sign to the end of the URL before we can past the proper URL for the resource in question. If we try to add the equals sign with the macro 
'''
new 856=‡zClick here to access book online‡uhttps://proxy.dml.vic.edu.au/login?url=
indicators=40
'''
and then run it we end up with the error
'''
Failed to run macro:
Line 1: unrecognized command
'''

Is there a way to (maybe) escape characters in macros so they can be printed to MARC?

Tasha Bales also reported on the Koha email list (2022-02-22) that she has also tried to substitute "=" and "=" on the macro with similar (non)results.

In response to Tasha's email Jonathan Druart replied (2022-02-24) that this patch may fix the problem:

'''
diff --git a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/macros/rancor.js
b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/macros/rancor.js
index e9b484ef600..f25e7273aaf 100644
--- a/koha-tmpl/intranet-tmpl/lib/koha/cateditor/macros/rancor.js
+++ b/koha-tmpl/intranet-tmpl/lib/koha/cateditor/macros/rancor.js
@@ -149,7 +149,7 @@ define( [ 'marc-editor' ], function( MARCEditor ) {
                 target.delete();
             }
         } ],
-        [ /^([^=]+)=([^=]*)$/, function( lhs_desc, rhs_desc ) {
+        [ /^([^=]+)=(.*)$/, function( lhs_desc, rhs_desc ) {
             var lhs_closure = _generate( _lhsGenerators, lhs_desc );
             if ( !lhs_closure ) return null;

'''