[Bug 27826] New: Self checkout dies on '?' as a barcode
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Bug ID: 27826 Summary: Self checkout dies on '?' as a barcode Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Self checkout Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org To recreate: 1 - Assign an item '?' as a barcode 2 - Check the item out to a patron 3 - Enable and visit the self checkout: http://localhost:8080/cgi-bin/koha/sco/sco-main.pl 4 - Try to load the patron with the item issued 5 - Boom! Error below: Template process failed: undef error - Quantifier follows nothing in regex; marked by <-- HERE in m/? <-- HERE / at /usr/lib/x86_64-linux-gnu/perl5/5.24/Template/VMethods.pm line 191. at /kohadevbox/koha/C4/Templates.pm line 122 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Depends on| |19458 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Caused by commit fff6777b35195dca489726875039c2bde6b52c2c Bug 19458: Self-check module highlighting Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19458 [Bug 19458] Self-check module highlighting -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #2 from HKS3 Tadeusz Sośnierz <tadeusz@sosnierz.com> --- Created attachment 197776 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197776&action=edit Bug 27826: Escape regexes when checking for new items in sco-main.tt Test plan: 1. In KTD, go to cgi-bin/koha/catalogue/detail.pl?biblionumber=11 2. Edit the item, set its biblionumber to "+12345" 3. Go to self-checkout at /cgi-bin/koha/sco/sco-main.pl, log in (42:koha) 4. Enter "+12345" into the "Scan a new item" input field, submit 5. Observe a crash 6. Apply patch 7. Refresh the page, observe no patch 8. Renew item, refresh a few times, to observe the "NEW" badge working as expected -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 HKS3 Tadeusz Sośnierz <tadeusz@sosnierz.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tadeusz@sosnierz.com Status|NEW |Needs Signoff --- Comment #3 from HKS3 Tadeusz Sośnierz <tadeusz@sosnierz.com> --- In self-review I noticed that it should in fact be a `_` operator to concatenate strings in TT, but this appears to work as expected regardless. Not too thrilled about this regex-matching approach to this anyway, but this does solve the problem so I'll leave it out here for review. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197776|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 197824 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197824&action=edit Bug 27826: Escape regexes when checking for new items in sco-main.tt Test plan: 1. In KTD, go to cgi-bin/koha/catalogue/detail.pl?biblionumber=11 2. Edit the item, set its biblionumber to "+12345" 3. Go to self-checkout at /cgi-bin/koha/sco/sco-main.pl, log in (42:koha) 4. Enter "+12345" into the "Scan a new item" input field, submit 5. Observe a crash 6. Apply patch 7. Refresh the page, observe no patch 8. Renew item, refresh a few times, to observe the "NEW" badge working as expected Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tadeusz@sosnierz.com |ity.org | CC| |david@davidnind.com --- Comment #5 from David Nind <david@davidnind.com> --- Added assignee. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA QA Contact|testopia@bugs.koha-communit |jonathan.druart@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197824|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 197893 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197893&action=edit Bug 27826: Escape regexes when checking for new items in sco-main.tt Test plan: 1. In KTD, go to cgi-bin/koha/catalogue/detail.pl?biblionumber=11 2. Edit the item, set its biblionumber to "+12345" 3. Go to self-checkout at /cgi-bin/koha/sco/sco-main.pl, log in (42:koha) 4. Enter "+12345" into the "Scan a new item" input field, submit 5. Observe a crash 6. Apply patch 7. Refresh the page, observe no patch 8. Renew item, refresh a few times, to observe the "NEW" badge working as expected Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #7 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 197894 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197894&action=edit Bug 27826: Add a Cypress test Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #8 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #7)
Created attachment 197894 [details] [review] Bug 27826: Add a Cypress test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
There is something not correct in this test, but it is passing for me like that. Look at the FIXME. Feel free to drop it if needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #9 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to main for 26.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes the release notes| |self-checkout feature so | |that barcodes with | |characters (such as ? or +) | |work. Previously, | |attempting to check out an | |item with such a barcode | |resulted in an error page. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #8)
(In reply to Jonathan Druart from comment #7)
Created attachment 197894 [details] [review] [review] Bug 27826: Add a Cypress test
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
There is something not correct in this test, but it is passing for me like that. Look at the FIXME. Feel free to drop it if needed.
It fails for me: SCO 1) "before each" hook for "Should not crash if barcode contains '+'" 0 passing (3s) 1 failing 1) SCO "before each" hook for "Should not crash if barcode contains '+'": CypressError: `cy.task('query')` failed with the following error:
Duplicate entry '+42+' for key 'itembarcodeidx'
Because it is leaving sample data in the DB. After I run: MariaDB [koha_kohadev]> SELECT count(*) FROM items WHERE barcode = '+42+'; +----------+ | count(*) | +----------+ | 1 | +----------+ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #11 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 198698 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198698&action=edit Bug 27826: Fix OPAC/SCO_spec.ts 1. The DELETE in afterEach was not needed 2. The test was failing randomly on the UPDATE of the beforeEach `Duplicate entry '+42+' for key 'itembarcodeidx'` I don't explain it, but this patch should fix the failure. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | --- Comment #12 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- follow-up pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #13 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 199501 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199501&action=edit Bug 27826: (RM follow-up) Attempt to fix failing test Patch from commit 54255e2 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #14 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- This test continues to fail on Jenkins but not locally. This is my attempt to fix it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Jacob O'Mara <jacob.omara@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable Version(s)|26.05.00 |26.05.00,25.11.05 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #15 from Jacob O'Mara <jacob.omara@openfifth.co.uk> --- Thanks all, pushed to 25.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #16 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 199514 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199514&action=edit Bug 27826: Turn on WebBasedSelfCheck to fix Cypress tests On Jenkins, SCO is not setup like it is in ktd after a reset_all from insert_data.pl 251 sub configure_selfcheckout { -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #17 from David Cook <dcook@prosentient.com.au> --- (In reply to HKS3 Tadeusz Sośnierz from comment #3)
In self-review I noticed that it should in fact be a `_` operator to concatenate strings in TT, but this appears to work as expected regardless. Not too thrilled about this regex-matching approach to this anyway, but this does solve the problem so I'll leave it out here for review.
Yeah I'm curious why we're even using regex match here... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 --- Comment #18 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Cook from comment #17)
(In reply to HKS3 Tadeusz Sośnierz from comment #3)
In self-review I noticed that it should in fact be a `_` operator to concatenate strings in TT, but this appears to work as expected regardless. Not too thrilled about this regex-matching approach to this anyway, but this does solve the problem so I'll leave it out here for review.
Yeah I'm curious why we're even using regex match here...
Because we are doing terrible things... 424 newissues => join( ',', @newissueslist ), 730 [% FOREACH barcode IN newissues.split(',') %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|additional_work_needed | --- Comment #19 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #16)
Created attachment 199514 [details] [review] Bug 27826: Turn on WebBasedSelfCheck to fix Cypress tests
On Jenkins, SCO is not setup like it is in ktd after a reset_all from insert_data.pl 251 sub configure_selfcheckout {
Still failing, see follow-up bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27826 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42705 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42705 [Bug 42705] OPAC/SCO_spec.ts is failing -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org