[Bug 10890] New: Autobarcode "<branch>yymm00001" Fails in Acquisitions When Receiving Item
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10890 Bug ID: 10890 Summary: Autobarcode "<branch>yymm00001" Fails in Acquisitions When Receiving Item Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org Currently, if autobarcode is set to "<branch>yymm00001", the barcode won't be created. Depending on your browser, you should receive a Javascript alert saying something like "Uncaught TypeError: Cannot read property 'field_value' of undefined". This looks like it's due to the form containing elements with a 'field_value' property missing the name "f". The easiest fix is to add a name of "f" to the form. That eliminates the problem and allows the barcode to be created. However, as Jared and Robin have pointed out, "f" is a really poor choice of names for a form. We should probably be using descriptive names for our forms. We should probably also be populating the barcode field in a way that doesn't rely on looping through the inputs of a form. Maybe we could just look for the branch code by doing $('#outeritemblock #subfielda') or something like that. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10890 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #0)
Currently, if autobarcode is set to "<branch>yymm00001", the barcode won't be created. Depending on your browser, you should receive a Javascript alert saying something like "Uncaught TypeError: Cannot read property 'field_value' of undefined".
This looks like it's due to the form containing elements with a 'field_value' property missing the name "f".
The easiest fix is to add a name of "f" to the form. That eliminates the problem and allows the barcode to be created.
However, as Jared and Robin have pointed out, "f" is a really poor choice of names for a form. We should probably be using descriptive names for our forms.
We should probably also be populating the barcode field in a way that doesn't rely on looping through the inputs of a form. Maybe we could just look for the branch code by doing $('#outeritemblock #subfielda') or something like that.
Actually, that last idea wouldn't work in the Cataloguing module although it might work in Acquisitions. We would need a cross module solution... -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10890 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10890 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Created attachment 21111 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=21111&action=edit Bug 10890 - Autobarcode "<branch>yymm00001" Fails in Acquisitions When Receiving Item This patch adds the name "f" to the form that adds items when placing or receiving an order in Acquisitions. This is needed so that the autobarcode code (which uses document.f.field_name) will work properly when the system preference is set to "<branch>yymm00001". AcqCreateItem "placing an order" "receiving an order" TEST PLAN 1) Set the autobarcode system preference to "<branch>yymm00001" 2) Set the AcqCreateItem system preference to "placing an order" 3) Plan an order 4) Try to add a barcode to the item in the AJAX form 5) Note that no barcode appears. Depending on your browser, you might receive a Javascript error popup message or a error icon at the bottom of your screen. You might receive no error message at all and it will fail seemingly silently. 6) Set the AcqCreateItem system preference to "receiving an order" 7) Receive the order 8) Try to add a barcode to the item in the AJAX form 9) See step 5. No barcode will appear and you might get an error message. 10) Apply the patch 11) Repeat steps 2, 3, 4, 6, 7, and 8 again. That is, try to add barcodes when placing an order and receiving an order. 12) Note that a barcode now appears with the pattern of <branch>yymm00001 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10890 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10890 I'm just a bot <gitbot@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gitbot@bugs.koha-community. | |org When did the bot| |2013-09-29 last check this| | --- Comment #3 from I'm just a bot <gitbot@bugs.koha-community.org> --- Patch applied cleanly, go forth and signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10890 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10890 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #21111|0 |1 is obsolete| | --- Comment #4 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Created attachment 21737 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=21737&action=edit [SIGNED-OFF] Bug 10890 - Autobarcode "<branch>yymm00001" Fails in Acquisitions When Receiving Item This patch adds the name "f" to the form that adds items when placing or receiving an order in Acquisitions. This is needed so that the autobarcode code (which uses document.f.field_name) will work properly when the system preference is set to "<branch>yymm00001". AcqCreateItem "placing an order" "receiving an order" TEST PLAN 1) Set the autobarcode system preference to "<branch>yymm00001" 2) Set the AcqCreateItem system preference to "placing an order" 3) Plan an order 4) Try to add a barcode to the item in the AJAX form 5) Note that no barcode appears. Depending on your browser, you might receive a Javascript error popup message or a error icon at the bottom of your screen. You might receive no error message at all and it will fail seemingly silently. 6) Set the AcqCreateItem system preference to "receiving an order" 7) Receive the order 8) Try to add a barcode to the item in the AJAX form 9) See step 5. No barcode will appear and you might get an error message. 10) Apply the patch 11) Repeat steps 2, 3, 4, 6, 7, and 8 again. That is, try to add barcodes when placing an order and receiving an order. 12) Note that a barcode now appears with the pattern of <branch>yymm00001 Signed-off-by: Srdjan <srdjan@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10890 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |katrin.fischer@bsz-bw.de --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- When creating multiple items, always the same barcode number is created. This will result in an error message on saving. Could this be improved so that the script notices the first number and counts? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10890 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=11273 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- This is certainly a duplicate of bug 11273 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10890 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no --- Comment #7 from Magnus Enger <magnus@libriotech.no> --- David: Can you confirm that this is a duplicate of bug 11273 (which is now Pushed to stable)? -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org