From 7a75e0b963c6fa7e087d5cd41dc9a777c1ebfa31 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 11 Jul 2018 18:55:06 -0300 Subject: [PATCH] Bug 21053: Encode URI characters in plugin 008 A # (or &) at any position in 008 field of a bib record causes all subsequent data in field to be overwritten with default values when record is saved. These characters need to be correctly encoded before being passed as parameters of the url To reproduce: 1. Find and edit a bib record which has an 008 which differs from the default values for the MARC framework 2. Choose 008 helper 3. Add # in any position before the end of the field noting the current values of the data 4. Save record 5. Edit record and select 008 helper 6. Review characters after # Signed-off-by: Maryse Simard Followed the test plan and it works. Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens (cherry picked from commit bfdf896111849454ade806bf49f48f1de5f626be) Signed-off-by: Martin Renvoize (cherry picked from commit 512ee5d57617c63da90be09268a77a0317c9e886) Signed-off-by: Fridolin Somers --- cataloguing/value_builder/marc21_field_008.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cataloguing/value_builder/marc21_field_008.pl b/cataloguing/value_builder/marc21_field_008.pl index 5da53dcdad..4acbb6946f 100755 --- a/cataloguing/value_builder/marc21_field_008.pl +++ b/cataloguing/value_builder/marc21_field_008.pl @@ -63,7 +63,7 @@ function Click$function_name(event) { //Only add the parameter to the URL if there is a value to add leader_parameter = \"&leader=\"+leader_value; } - newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue+leader_parameter,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); + newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008.pl&index=\"+ event.data.id +\"&result=\"+encodeURIComponent(defaultvalue)+leader_parameter,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); } //]]> -- 2.39.5