Bug 3544 - Value builder plug-ins don't work with repeatable subfields
Summary: Value builder plug-ins don't work with repeatable subfields
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: PC All
: P5 - low normal
Assignee: Galen Charlton
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-21 02:33 UTC by Chris Cormack
Modified: 2026-01-19 08:34 UTC (History)
5 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:11:57 UTC


---- Reported by brian@jhu.edu 2009-08-21 14:33:39 ----

When the user clones a subfield, clicking in the new subfield activates the plug-in, but it modifies the parent rather than the clone.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:11 UTC  ---

This bug was previously known as _bug_ 3544 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3544

Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was brian@jhu.edu.

Comment 1 Mirko Tietgen 2012-12-16 13:57:11 UTC
This appears to still be valid.
Comment 2 Katrin Fischer 2019-05-04 14:37:43 UTC
Do we have a good example to test for a plugin on a repeatable subfield? All I got was plugins on repeatable fields when trying to test this.
Comment 3 Florian 2022-03-25 17:32:57 UTC
I'm currently working on trying to find the source of this glitch. 
When cloning subfields, the clone/child tag editor event handler takes the parent subfield id for the onAuth function.
I thought the problem came from the AddEventHandler function in cataloguing.js, but comments there say that the function moved to _data since jQuery 1.8.

For testing purposes, I used the unimarc_field_128b.pl plugin.
Comment 4 Jonathan Druart 2022-06-08 09:02:32 UTC
Did you try that?

diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js
index 16cf8574968..afc1c3caa42 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js
@@ -433,7 +433,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)[0], 'events');
     if(typeof ev != 'undefined') {
         $.each(ev, function(prop,val) {
             $.each(val, function(prop2,val2) {
Comment 5 Florian 2022-06-08 10:28:49 UTC
Just tried your solution, no visible changes sadly.
Comment 6 Jonathan Druart 2022-06-08 11:00:35 UTC
I've tried with the upload plugin and I can click on the plugin link to open the pop-up window, select a file and it fill in the correct input with the filepath.
Comment 7 Katrin Fischer 2022-06-16 15:14:26 UTC
I've heard a similar complaint recently, could it be a browser issue?
Comment 8 Katrin Fischer 2022-06-16 15:23:55 UTC
I see you linked bug 30975 already, could this be a duplicate?
Comment 9 Daphne Hoolahan 2024-08-28 13:34:55 UTC
You can also recreate this problem if you clone tag 007, when you click on the tag editor icon it should use marc21_field_007.pl but it does not
Comment 10 Emmi Takkinen 2026-01-19 08:34:56 UTC
This is still an issue at least in version 25.05, duplicating fields using our custom value builder plugins breaks plugins. It seems that issue was temporarily fixed on bug 33744 but it was then reverted in bug 30975.