Bugzilla – Attachment 143738 Details for
Bug 32175
Item info not cloning when receiving multiple items due to Flatpickr issue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32175: Prevent Javascript error by checking for kohafield sibling
Bug-32175-Prevent-Javascript-error-by-checking-for.patch (text/plain), 1.97 KB, created by
David Cook
on 2022-11-10 23:33:12 UTC
(
hide
)
Description:
Bug 32175: Prevent Javascript error by checking for kohafield sibling
Filename:
MIME Type:
Creator:
David Cook
Created:
2022-11-10 23:33:12 UTC
Size:
1.97 KB
patch
obsolete
>From b7050039ab6f12916e6057f4d5ed8aa44deafcb8 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Thu, 10 Nov 2022 23:28:54 +0000 >Subject: [PATCH] Bug 32175: Prevent Javascript error by checking for kohafield > sibling > >This patch checks for kohafield sibling before proceeding with >data clone when creating items during receival. > >If the kohafield sibling is not available, don't try to clone the >value. > >Test plan: >1. Create a test vendor >2. Create a test basket (create item on receival) >3. Create a test order for 3 items >4. Close the test basket >5. Receive the order >6. Fill out many item fields including "Date acquired" >7. Click "Add item" >8. Note that the fields aren't cloned and there is a Javascript error >in the console > >9. Apply the patch > >10. Refresh the page >11. Fill out many item fields including "Date acquired" >12. Click "Add item" >13. Note that the fields are cloned, except "Date acquired" >--- > koha-tmpl/intranet-tmpl/prog/js/additem.js | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/additem.js b/koha-tmpl/intranet-tmpl/prog/js/additem.js >index a83310f29d..6f1a68f3a3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/additem.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/additem.js >@@ -191,7 +191,8 @@ function cloneItemBlock(index, unique_item_fields, callback) { > /* Copy values from the original block (input) */ > $(original).find("input[name='field_value']").each(function(){ > var kohafield = $(this).siblings("input[name='kohafield']").val(); >- if($(this).val() && $.inArray(kohafield,dont_copy_fields) == -1) { >+ //NOTE: flatpickr_wrapper prevents kohafield from being found >+ if(kohafield && $(this).val() && $.inArray(kohafield,dont_copy_fields) == -1) { > $(this).parent("div").attr("id").match(/^(subfield.)/); > var id = RegExp.$1; > var value = $(this).val(); >-- >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 32175
: 143738