Summary: | Plugins not working on duplicated MARC fields | ||
---|---|---|---|
Product: | Koha | Reporter: | Matt Blenkinsop <matt.blenkinsop> |
Component: | Cataloging | Assignee: | Matt Blenkinsop <matt.blenkinsop> |
Status: | RESOLVED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | trivial | ||
Priority: | P5 - low | CC: | david, fridolin.somers, m.de.rooy, patrick.robitaille |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30975 | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.11.00,23.05.04,22.11.10
|
|
Circulation function: | |||
Attachments: |
Bug 33744: Fix deprecated use of .data('events')
Bug 33744: Fix deprecated use of .data('events') Bug 33744: Fix deprecated use of .data('events') Bug 33744: Fix cloning (sub)fields with framework plugins |
Description
Matt Blenkinsop
2023-05-16 11:12:35 UTC
*** This bug has been marked as a duplicate of bug 30975 *** Created attachment 151270 [details] [review] 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. > This patch removes a deprecated internal data structure no longer supported in jQuery.
// 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");
You are using an internal structure here. Where we really dont know how long it will be supported.
Perhaps we can use it as a temporary workaround until 30975 gets in ? 30975 is still blocked so maybe Marcel is right and we should use this patch as a temporary fix - I'll rebase and re-submit Created attachment 153538 [details] [review] 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. Created attachment 154796 [details] [review] 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. Signed-off-by: David Nind <david@davidnind.com> I've added some comments to bug 30975 (comment 45) on whether to go ahead with 30975 as is, or go ahead with this one as a temporary measure. From the user perspective, maybe getting cloning of subfields with plugins/value builders should be the priority? Looking here Created attachment 155081 [details] [review] Bug 33744: Fix cloning (sub)fields with framework plugins This patch is meant as a temporary measure for fixing the problem. Bug 30975 may resolve it further, but this is good for now. Note: The original commit message referred to removing a deprecated internal structure. But this patch actually still uses the structure which has been moved to _data in jQuery now. 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. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> (In reply to David Nind from comment #8) > 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 Took the liberty to further clarify this statement in the commit message. Pushed to master for 23.11. Nice work everyone, thanks! Pushed to 23.05.x for 23.05.04 Nice work everyone! Pushed to oldstable for 22.11.x |