Bugzilla – Attachment 128490 Details for
Bug 29689
Update to 21.11 broken auto-generated barcode in <branchcode>0001 option
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29689: (bug 28445 follow-up) Fix AutoBarcode=hbyymmincr
Bug-29689-bug-28445-follow-up-Fix-AutoBarcodehbyym.patch (text/plain), 1.85 KB, created by
Jonathan Druart
on 2021-12-14 11:14:10 UTC
(
hide
)
Description:
Bug 29689: (bug 28445 follow-up) Fix AutoBarcode=hbyymmincr
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-12-14 11:14:10 UTC
Size:
1.85 KB
patch
obsolete
>From 6afe89505ab28da0eb5305df466bb97837fa7495 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 14 Dec 2021 12:08:13 +0100 >Subject: [PATCH] Bug 29689: (bug 28445 follow-up) Fix AutoBarcode=hbyymmincr > >The selector is not correct, we need to use .input_marceditor instead of >name="field_value". > >Test plan: >Set autoBarcode=<branchcode>yymm0001 >Catalogue a new item, click into the barcode input >Notice that without this patch you get a JS error in the console > >Uncaught TypeError: form.field_value is undefined > Focustag_952_subfield_p_878344 > Focustag_952_subfield_p_878344_handler > jQuery 11 > BindEventstag_952_subfield_p_878344 > >With this patch applied the barcode is correctly generated. > >QA Note: it would be way easier if all add item forms were using the new >methods, it could be: > let loc = document.getElementsByName('items.homebranch')[0].value; >Yes, that's all! >--- > C4/Barcodes/ValueBuilder.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Barcodes/ValueBuilder.pm b/C4/Barcodes/ValueBuilder.pm >index ea8bffafa37..1bef9cdbfaf 100644 >--- a/C4/Barcodes/ValueBuilder.pm >+++ b/C4/Barcodes/ValueBuilder.pm >@@ -64,13 +64,13 @@ sub get_barcode { > if ( !form ) { > form = document.getElementById('Aform'); > } >- for (i=0 ; i<form.field_value.length ; i++) { >+ for (i=0 ; i<form.getElementsByClassName('input_marceditor').length ; i++) { > if (form.tag[i].value == '$args->{loctag}' && form.subfield[i].value == '$args->{locsubfield}') { > fnum = i; > } > } > if (\$('#' + id).val() == '') { >- \$('#' + id).val(form.field_value[fnum].value + '$nextnum'); >+ \$('#' + id).val(form.getElementsByClassName('input_marceditor')[fnum].value + '$nextnum'); > } > "; > return $nextnum, $scr; >-- >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 29689
:
128480
|
128490
|
128521
|
128727
|
128800
|
128860