Bugzilla – Attachment 70224 Details for
Bug 18183
jQuery append error related to script tags in cloneItemBlock
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18183: jQuery append error related to script tags in cloneItemBlock
Bug-18183-jQuery-append-error-related-to-script-ta.patch (text/plain), 2.30 KB, created by
Josef Moravec
on 2018-01-02 10:59:19 UTC
(
hide
)
Description:
Bug 18183: jQuery append error related to script tags in cloneItemBlock
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-01-02 10:59:19 UTC
Size:
2.30 KB
patch
obsolete
>From 52b6fcf1bd5fb115ae49fc644ff9af83464708ec Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Tue, 28 Feb 2017 14:26:22 +0100 >Subject: [PATCH] Bug 18183: jQuery append error related to script tags in > cloneItemBlock > >See the detailed explanation of the error on Bugzilla. >As a workaround, we move the append of clone to outeritemblock before the >append of data (long string with item fields and script tags) to clone. > >This patch also moves two vars inside the success function, since they are >not used outside of it. > >Test plan: >[1] Set AcqCreateItem to receiving. >[2] Receive an order. Verify that adding, updating or deleting an item block > still works as expected. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > koha-tmpl/intranet-tmpl/prog/js/additem.js | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/additem.js b/koha-tmpl/intranet-tmpl/prog/js/additem.js >index 0f93310..6e4bf33 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/additem.js >@@ -161,8 +161,6 @@ function cloneItemBlock(index, unique_item_fields, callback) { > } > } > >- var random = Math.floor(Math.random()*100000); // get a random itemid. >- var clone = $("<div id='itemblock"+random+"'></div>") > $.ajax({ > url: "/cgi-bin/koha/services/itemrecorddisplay.pl", > dataType: 'html', >@@ -171,6 +169,9 @@ function cloneItemBlock(index, unique_item_fields, callback) { > }, > success: function(data, textStatus, jqXHR) { > /* Create the item block */ >+ var random = Math.floor(Math.random()*100000); // get a random itemid. >+ var clone = $("<div/>", { id: 'itemblock'+random }); >+ $("#outeritemblock").append(clone); > $(clone).append(data); > /* Change all itemid fields value */ > $(clone).find("input[name='itemid']").each(function(){ >@@ -209,7 +210,6 @@ function cloneItemBlock(index, unique_item_fields, callback) { > } > }); > >- $("#outeritemblock").append(clone); > if (typeof callback === "function"){ > var cloneIndex = "itemblock"+random; > callback(cloneIndex); >-- >2.1.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 18183
:
60731
|
67821
| 70224