From 5088aeea8b4fe61899b4f7f75d349eb84044f607 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Tue, 16 May 2023 11:14:01 +0000 Subject: [PATCH] Bug 33744: Fix deprecated use of .data('events') This patch removes a deprecated internal data structure no longer supported in jQuery. This means that AddEventHandlers now correctly passes events to cloned fields in the MARC record Test plan: 1) Apply patch 2) Repeat steps in the original bug description 3) This time clicking on the Upload button for a cloned field should launch the uploads pop up. --- koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js index d6f6715cc3..f8337e1dd9 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js +++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js @@ -434,7 +434,7 @@ function AddEventHandlers (oldcontrol, newcontrol, newinputid ) { // newinputid is the id attribute of the cloned controlling input field // Note: This code depends on the jQuery data for events; this structure // is moved to _data as of jQuery 1.8. - var ev= $(oldcontrol).data('events'); + var ev = $._data(oldcontrol, "events"); if(typeof ev != 'undefined') { $.each(ev, function(prop,val) { $.each(val, function(prop2,val2) { -- 2.37.1 (Apple Git-137.1)