Bugzilla – Attachment 177615 Details for
Bug 30975
Use event delegation for framework plugins to avoid using private jQuery method _data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30975: (QA follow-up) Fix for authorities and upload plugin
Bug-30975-QA-follow-up-Fix-for-authorities-and-upl.patch (text/plain), 5.64 KB, created by
Marcel de Rooy
on 2025-02-07 10:41:27 UTC
(
hide
)
Description:
Bug 30975: (QA follow-up) Fix for authorities and upload plugin
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-02-07 10:41:27 UTC
Size:
5.64 KB
patch
obsolete
>From eea5cdfd1dec84086ba56c67317dd6130d9f2e8b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 7 Feb 2025 10:33:05 +0000 >Subject: [PATCH] Bug 30975: (QA follow-up) Fix for authorities and upload > plugin >Content-Type: text/plain; charset=utf-8 > >Authorities still needed a few tweaks for text2 (obscure name for >plugins). >Upload plugin does not have buttonDot 'mark'. Cloning was still >an issue. Not the most elegant solution but it works. We should >not have this exception for just another icon or so. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../prog/en/modules/authorities/authorities.tt | 6 +++--- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt | 6 +++--- > koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 2 +- > 3 files changed, 7 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >index 021922bcce..8dbfdf7816 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >@@ -732,8 +732,8 @@ > </select> > [% ELSIF ( mv.type == 'text1' ) %] > <input type="text" id="[%- mv.id | html -%]" name="[%- mv.id | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" /> >- [% ELSIF ( mv.type == 'text2' ) %] >- <input type="text" id="[%- mv.id | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" /> >+ [% ELSIF ( mv.type == 'text2' ) # plugin %] >+ <input type="text" id="[%- mv.id | html -%]" size="67" maxlength="[%- mv.maxlength | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" data-plugin="[% mv.plugin | html %]" class="input_marceditor framework_plugin" /> > [% ELSIF ( mv.type == 'text' ) %] > <input type="text" id="[%- mv.id | html -%]" name="[%- mv.name | html -%]" value="[%- mv.value | html -%]" class="input_marceditor" tabindex="1" size="67" maxlength="[%- mv.maxlength | html -%]" /> > [% ELSIF ( mv.type == 'textarea' ) %] >@@ -758,7 +758,7 @@ > [% IF mv.noclick %] > <a href="#" class="buttonDot tag_editor disabled" tabindex="-1" title="No popup">...</a> > [% ELSE %] >- <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor" title="Tag editor" data-plugin="[% mv.plugin | html %]">...</a> >+ <a href="#" id="buttonDot_[% mv.id | html %]" class="buttonDot tag_editor framework_plugin" title="Tag editor" data-plugin="[% mv.plugin | html %]">...</a> > [% END %] > [% mv.javascript | $raw %] > [% END #/IF ( mv.type == 'text1' ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >index b14a9eda42..9592a548c2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt >@@ -475,9 +475,9 @@ > var res = '[% Koha.Preference('OPACBaseURL') | html %]'; > res = res.replace( /\/$/, ''); > res = res + '/cgi-bin/koha/opac-retrieve-file.pl?id=' + hashval; >- [% IF index %] >- $(window.opener.document).find('#[% index | html %]').val( res ); >- [% END %] >+ var index = '[% index | html %]'; >+ index = index.replace( /^buttonDot_/, '' ); >+ if(index) $(window.opener.document).find('#'+index).val( res ); > window.close(); > } > var table_settings = [% TablesSettings.GetTableSettings( 'tools', 'upload', 'uploadresults', 'json' ) | $raw %]; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >index 43613ec420..bd067cc081 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >@@ -629,7 +629,7 @@ $(document).ready(function() { > const plugin = event.target.getAttribute('data-plugin'); > if (plugin && plugin in Koha.frameworkPlugins && event.type in Koha.frameworkPlugins[plugin]) { > event.data = {}; >- if (event.target.classList.contains('buttonDot')) { >+ if (event.target.classList.contains('framework_plugin') || event.target.classList.contains('buttonDot') ) { > event.data.id = event.target.closest('.subfield_line').querySelector('input.input_marceditor').id; > } else { > event.data.id = event.target.id; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30975
:
136135
|
138318
|
140763
|
140810
|
146146
|
146817
|
158064
|
170499
|
170500
|
171513
|
171514
|
175432
|
175433
|
175434
|
175435
|
175436
|
175437
|
177612
|
177613
|
177614
|
177615
|
177616
|
177719
|
177720
|
177721
|
177722
|
177723