Entering a valid barcode into the self-checkout modal returns an error "Message code 'UNKNOWN_BARCODE' with data '1'" Requires OpacTrustedCheckout to be enabled
This is due to a change introduced in Bug 38505 kohadev-koha@kohadevbox:koha((v24.11.02-1))$ git checkout origin/main Previous HEAD position was 7707a62f91f Update release notes for 24.11.02 release HEAD is now at cb89b42f817 Bug 38663: DBIC schema update kohadev-koha@kohadevbox:koha((cb89b42f817...))$ git bisect start status: waiting for both good and bad commits kohadev-koha@kohadevbox:koha((cb89b42f817...)|BISECTING)$ git bisect bad status: waiting for good commit(s), bad commit known kohadev-koha@kohadevbox:koha((cb89b42f817...)|BISECTING)$ git bisect good v24.11.02-1 Bisecting: a merge base must be tested [9bbb73fa2682d9065f42ffde5fa4548dc8592d43] Koha 24.11 is here! kohadev-koha@kohadevbox:koha((v24.11.00)|BISECTING)$ git bisect good Bisecting: 553 revisions left to test after this (roughly 9 steps) [c57cd77bd29e7da7f27333e7abb546f23421908b] Bug 38714: biblio-title-head.inc kohadev-koha@kohadevbox:koha((c57cd77bd29...)|BISECTING)$ git bisect bad Bisecting: 276 revisions left to test after this (roughly 8 steps) [143220d0c6d2d82bc007be029221ee3ede676f2f] Bug 37832: Fix Rental discount to be decimal like other similar fields kohadev-koha@kohadevbox:koha((143220d0c6d...)|BISECTING)$ git bisect bad Bisecting: 138 revisions left to test after this (roughly 7 steps) [4fb4b7527ef80519a6ff9c794505fc128d62c534] Bug 37761: Add focus on patron search when on the tab kohadev-koha@kohadevbox:koha((4fb4b7527ef...)|BISECTING)$ git bisect good Bisecting: 69 revisions left to test after this (roughly 6 steps) [04c095c4734e6851637382e5c50081fd0933183c] Bug 34068: Add tests kohadev-koha@kohadevbox:koha((04c095c4734...)|BISECTING)$ git bisect good Bisecting: 34 revisions left to test after this (roughly 5 steps) [9f5f4aa1d63f24c7aa84e2428f67825e6feba0b3] Bug 38503: Do not list the objects kohadev-koha@kohadevbox:koha((9f5f4aa1d63...)|BISECTING)$ git bisect bad Bisecting: 17 revisions left to test after this (roughly 4 steps) [ecd0604a8ded12803846de6d3e7dac5e9eed2765] Bug 38505: CirculateILL: Add UNKNOWN_BARCODE warning message kohadev-koha@kohadevbox:koha((ecd0604a8de...)|BISECTING)$ git bisect bad Bisecting: 8 revisions left to test after this (roughly 3 steps) [2a6bc075f6c7c7eadda044dda892d36997884f50] Bug 38751: Add tests kohadev-koha@kohadevbox:koha((2a6bc075f6c...)|BISECTING)$ git bisect good Bisecting: 4 revisions left to test after this (roughly 2 steps) [c42cfecd43b36048414615622f7121c7de31e657] Bug 37448: Add build_sample_ill_request kohadev-koha@kohadevbox:koha((c42cfecd43b...)|BISECTING)$ git bisect good Bisecting: 2 revisions left to test after this (roughly 1 step) [45626c75c4d83075892015233634106814f26942] Bug 38505: CanBookBeIssued preparation: Add tests for falsy barcode kohadev-koha@kohadevbox:koha((45626c75c4d...)|BISECTING)$ git bisect good Bisecting: 0 revisions left to test after this (roughly 1 step) [90304e7632547fcb275d93a88afc88e4a52dd1ed] Bug 38505: ill-requests.tt: Use .alert-warning when .alert exists kohadev-koha@kohadevbox:koha((90304e76325...)|BISECTING)$ git bisect bad Bisecting: 0 revisions left to test after this (roughly 0 steps) [89b7f160a75e063582793a30636c137ddacdc96d] Bug 38505: CanBookBeIssued preparation: Appropriate behavior when barcode is falsy kohadev-koha@kohadevbox:koha((89b7f160a75...)|BISECTING)$ git bisect bad 89b7f160a75e063582793a30636c137ddacdc96d is the first bad commit commit 89b7f160a75e063582793a30636c137ddacdc96d Author: Pedro Amorim <pedro.amorim@ptfs-europe.com> Date: Thu Nov 21 14:23:19 2024 -0100 Bug 38505: CanBookBeIssued preparation: Appropriate behavior when barcode is falsy Before applying this patch, apply the CanBookBeIssued preparation: tests patch and run that, Verify it fails, apply this patch. Run that same tests file again. ----- About this change ----- CanBookBeIssued wants to find one item given a barcode. If a falsy (undef, empty) barcode is supplied, UNKNOWN_BARCODE should be returned. Ensure this change does not introduce any regressions: prove t/db_dependent/Circulation* prove t/db_dependent/DecreaseLoanHighHolds.t prove t/db_dependent/rollingloans.t prove t/db_dependent/api/v1/checkouts.t prove t/db_dependent/Patron/Borrower_PrevCheckout.t Signed-off-by: Ray Delahunty <r.delahunty@arts.ac.uk> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> C4/Circulation.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Created attachment 179191 [details] [review] Bug 39313: Make OpacTrustedCheckout self-checkout modal accept valid barcode This patch fixes a regression introduced by Bug 38505. To test: 1. Enabled OpacTrustedCheckout system preference 2. Search for an item and get the barcode 3. Go to the OPAC 4. Click the Self-checkout button at the top 5. Enter the barcode and submit 6. Notice you are given an error UNKNOWN_BARCODE and the item is not checked out 7. Apply the patch and restart services 8. Repeat steps 4-6 and confirm you are able to successfully check out the item 9. Test submitting the modal with no barcode entered - confirm you are shown an appropriate error 10. Test with a fake barcode that does not exist - confirm you are shown an appropriate error 11. Run tests to confirm no regressions prove t/db_dependent/Circulation* prove t/db_dependent/DecreaseLoanHighHolds.t prove t/db_dependent/rollingloans.t prove t/db_dependent/api/v1/checkouts.t prove t/db_dependent/Patron/Borrower_PrevCheckout.t prove t/db_dependent/Koha/ILL/Requests.t Sponsored-by: Reserve Bank of New Zealand
Created attachment 179192 [details] [review] Bug 39313: Make OpacTrustedCheckout self-checkout modal accept valid barcode This patch fixes a regression introduced by Bug 38505. To test: 1. Enabled OpacTrustedCheckout system preference 2. Search for an item and get the barcode 3. Go to the OPAC 4. Click the Self-checkout button at the top 5. Enter the barcode and submit 6. Notice you are given an error UNKNOWN_BARCODE and the item is not checked out 7. Apply the patch and restart services 8. Repeat steps 4-6 and confirm you are able to successfully check out the item 9. Test submitting the modal with no barcode entered - confirm you are shown an appropriate error 10. Test with a fake barcode that does not exist - confirm you are shown an appropriate error 11. Run tests to confirm no regressions prove t/db_dependent/Circulation* prove t/db_dependent/DecreaseLoanHighHolds.t prove t/db_dependent/rollingloans.t prove t/db_dependent/api/v1/checkouts.t prove t/db_dependent/Patron/Borrower_PrevCheckout.t prove t/db_dependent/Koha/ILL/Requests.t Sponsored-by: Reserve Bank of New Zealand Signed-off-by: Magnus Enger <magnus@libriotech.no> Works as advertised, including the tests.
Created attachment 179196 [details] [review] Bug 39313: Make OpacTrustedCheckout self-checkout modal accept valid barcode This patch fixes a regression introduced by Bug 38505. To test: 1. Enabled OpacTrustedCheckout system preference 2. Search for an item and get the barcode 3. Go to the OPAC 4. Click the Self-checkout button at the top 5. Enter the barcode and submit 6. Notice you are given an error UNKNOWN_BARCODE and the item is not checked out 7. Apply the patch and restart services 8. Repeat steps 4-6 and confirm you are able to successfully check out the item 9. Test submitting the modal with no barcode entered - confirm you are shown an appropriate error 10. Test with a fake barcode that does not exist - confirm you are shown an appropriate error 11. Run tests to confirm no regressions prove t/db_dependent/Circulation* prove t/db_dependent/DecreaseLoanHighHolds.t prove t/db_dependent/rollingloans.t prove t/db_dependent/api/v1/checkouts.t prove t/db_dependent/Patron/Borrower_PrevCheckout.t prove t/db_dependent/Koha/ILL/Requests.t Sponsored-by: Reserve Bank of New Zealand Signed-off-by: Magnus Enger <magnus@libriotech.no> Works as advertised, including the tests. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
We should add a unit test for this to prevent a future regression
Created attachment 179296 [details] [review] Bug 39313: Unit test for passing valid item object to CanBookBeIssued rather than a barcode. Will be tested within previous test plan. Sponsored-by: Reserve Bank of New Zealand
Created attachment 179324 [details] [review] Bug 39313: Unit test for passing valid item object to CanBookBeIssued rather than a barcode. Will be tested within previous test plan. Sponsored-by: Reserve Bank of New Zealand Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 179327 [details] [review] Bug 39313: Make OpacTrustedCheckout self-checkout modal accept valid barcode This patch fixes a regression introduced by Bug 38505. To test: 1. Enabled OpacTrustedCheckout system preference 2. Search for an item and get the barcode 3. Go to the OPAC 4. Click the Self-checkout button at the top 5. Enter the barcode and submit 6. Notice you are given an error UNKNOWN_BARCODE and the item is not checked out 7. Apply the patch and restart services 8. Repeat steps 4-6 and confirm you are able to successfully check out the item 9. Test submitting the modal with no barcode entered - confirm you are shown an appropriate error 10. Test with a fake barcode that does not exist - confirm you are shown an appropriate error 11. Run tests to confirm no regressions prove t/db_dependent/Circulation* prove t/db_dependent/DecreaseLoanHighHolds.t prove t/db_dependent/rollingloans.t prove t/db_dependent/api/v1/checkouts.t prove t/db_dependent/Patron/Borrower_PrevCheckout.t prove t/db_dependent/Koha/ILL/Requests.t Sponsored-by: Reserve Bank of New Zealand Signed-off-by: Magnus Enger <magnus@libriotech.no> Works as advertised, including the tests. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 179328 [details] [review] Bug 39313: Unit test for passing valid item object to CanBookBeIssued rather than a barcode. Will be tested within previous test plan. Sponsored-by: Reserve Bank of New Zealand Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Thankyou :)
Pushed for 25.05! Well done everyone, thank you!
Pushed to 24.11.x for 24.11.06
Don't believe this is needed in 24.05.x. Please let me know if I'm wrong.
Not backporting to 22.11
Bug fix, no changes to the manual required.