Bugzilla – Attachment 128161 Details for
Bug 28853
Textarea in biblio record editor breaks authority plugin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28853: Fix authority plugin when textarea in biblio record editor
Bug-28853-Fix-authority-plugin-when-textarea-in-bi.patch (text/plain), 2.83 KB, created by
Jonathan Druart
on 2021-12-02 13:26:23 UTC
(
hide
)
Description:
Bug 28853: Fix authority plugin when textarea in biblio record editor
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-12-02 13:26:23 UTC
Size:
2.83 KB
patch
obsolete
>From 0a87b3b29b0a2dadc3c5fb324f90f715b20ea210 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 12 Aug 2021 10:30:17 -1000 >Subject: [PATCH] Bug 28853: Fix authority plugin when textarea in biblio > record editor > >In biblio record editor, when subfield value contains more than 100 characters the editor uses a textarea instead of an input. >On a field using authority plugin, this breaks the JavaScript because it only searches for input tags : >In /koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt : >> this.getElementsByTagName('input')[1].value = values[i]; > >Test plan : >1) Prepare : >1.1) Create a new biblio record with a field using authority plugin, for example 606 >1.2) Do not use authority plugin but enter in 606$x more than 100 chars >1.3) Save record >1.4) Create a new autority for 606 biblio field with $a and a $x containing more than 100 chars >2) Test 1 : >2.1) Edit again the biblio record, you see a text area for 606$x >2.2) Use authority plugin on field 606 >2.3) Search and choose the new autority >2.4) Check $a,$x and $9 are well filled >3) Test 2 : >3.1) Empty field 606 >3.2) Create a second $x subfield and fill it with a random value >3.3) Use authority plugin again on field 606 >3.4) Search and choose the new autority >3.5) Check $a and $9 are well filled >3.6) Check first $x contains the value from autority and second $x is empty > >Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../en/modules/authorities/blinddetail-biblio-search.tt | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt >index 3a16fef3fda..1aff010193a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tt >@@ -99,12 +99,14 @@ > // Add the new values to those subfields, empty the additional fields > var i=0; > subfields.each(function() { >- if(i in values) { >- this.getElementsByTagName('input')[1].value = values[i]; >+ var new_value; >+ if (i in values) { >+ new_value = values[i]; > } > else { >- this.getElementsByTagName('input')[1].value = ""; >+ new_value = ""; > } >+ $(this).find('.input_marceditor').val(new_value); > i++; > }); > } >-- >2.25.1
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 28853
:
123819
|
127348
| 128161