Bugzilla – Attachment 55079 Details for
Bug 17152
Duplicating a subfield should not copy the data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17152: (counter-patch)Do not copy value when duplicating a subfield
Bug-17152-counter-patchDo-not-copy-value-when-dupl.patch (text/plain), 2.07 KB, created by
Héctor Eduardo Castro Avalos
on 2016-08-31 19:36:00 UTC
(
hide
)
Description:
Bug 17152: (counter-patch)Do not copy value when duplicating a subfield
Filename:
MIME Type:
Creator:
Héctor Eduardo Castro Avalos
Created:
2016-08-31 19:36:00 UTC
Size:
2.07 KB
patch
obsolete
>From 62e73249559f7f5b20a2b94a2292b47bf181fb47 Mon Sep 17 00:00:00 2001 >From: Hector Castro <hector.hecaxmmx@gmail.com> >Date: Wed, 31 Aug 2016 13:33:53 -0600 >Subject: [PATCH] Bug 17152: (counter-patch)Do not copy value when duplicating > a subfield > >When cataloguing, if you want to duplicate a subfield that is not >empty, the new subfield is created with a copy of data in it. >This is not the case when you duplicate an whole field. The new one is >created with subfields but without data in it. > >Test plan: >Add or edit a bibliographic record >Fill a subfield >Duplicate the subfield >=> Without this patch the value of the input will be copied >=> With this patch the new input will be emptied >--- > koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >index c23637f..5f645c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/cataloging.js >@@ -255,7 +255,6 @@ function CloneSubfield(index, advancedMARCEditor){ > var original = document.getElementById(index); //original <div> > var clone = original.cloneNode(true); > var new_key = CreateKey(); >- > // set the attribute for the new 'div' subfields > var inputs = clone.getElementsByTagName('input'); > var selects = clone.getElementsByTagName('select'); >@@ -270,6 +269,7 @@ function CloneSubfield(index, advancedMARCEditor){ > inputs[i].setAttribute('name',inputs[i].getAttribute('name')+new_key); > linkid = id_input; > } >+ > // Plugin input > if( $(inputs[1]).hasClass('framework_plugin') ) { > var oldcontrol= original.getElementsByTagName('input')[1]; >@@ -326,6 +326,8 @@ function CloneSubfield(index, advancedMARCEditor){ > } > // insert this line on the page > original.parentNode.insertBefore(clone,original.nextSibling); >+ // delete data of cloned subfield >+ document.getElementById(linkid).value = ""; > } > > function AddEventHandlers (oldcontrol, newcontrol, newinputid ) { >-- >1.7.10.4
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 17152
:
54784
|
54996
|
55078
|
55079
|
55234
|
55276