When you add items to a rotating collection by copy and pasting the barcode, there will often be whitespace causing a 'barcode not found' error. We should automatically remove/ignore this leading/trailing whitespace as we do in other forms like the checkout/checkin forms.
Hi Katrin, the whitespace doesn't affect the submission in the rotating collection page while adding new collection on my side. Let me know if you still have this issue.
Can confirm that barcode whitespace is still not handled well in upstream To reproduce: 1. Go to Tools -> Rotating collections 2. Create a rotating collection 3. Chose Actions -> Manage items 4. Paste a barcode and put some spaces around it, for example " 39999000010053 " 5. Click Submit => Shown an error, no item with matching barcode found, though the barcode is printed without all the whitespace
Created attachment 184263 [details] [review] Bug 31930: Ignore whitespace before and after barcodes Decoded the barcode in add items to collection. Test plan: 1. Go to Tools -> Rotating collections 2. Create a rotating collection 3. Chose Actions -> Manage items 4. Paste a barcode and put some spaces around it, for example " 39999000010053 " 5. Click Submit => Shown an error, no item with matching barcode found, though the barcode is printed without all the whitespace 6. Apply patch 7. Repeat steps 1 - 5, barcode should be accepted
Created attachment 184264 [details] [review] Bug 31930: Ignore whitespace before and after barcodes Decoded the barcode in add items to collection. Test plan: 1. Go to Tools -> Rotating collections 2. Create a rotating collection 3. Chose Actions -> Manage items 4. Paste a barcode and put some spaces around it, for example " 39999000010053 " 5. Click Submit => Shown an error, no item with matching barcode found, though the barcode is printed without all the whitespace 6. Apply patch 7. Repeat steps 1 - 5, barcode should be accepted
Created attachment 184274 [details] [review] Bug 31930: Ignore whitespace before and after barcodes Decoded the barcode in add items to collection. Test plan: 1. Go to Tools -> Rotating collections 2. Create a rotating collection 3. Chose Actions -> Manage items 4. Paste a barcode and put some spaces around it, for example " 39999000010053 " 5. Click Submit => Shown an error, no item with matching barcode found, though the barcode is printed without all the whitespace 6. Apply patch 7. Repeat steps 1 - 5, barcode should be accepted Signed-off-by: David Nind <david@davidnind.com>
Nice work Yvonne, and thanks for the patch! I've added a draft release note. David Nind Testing notes (using koha-testing-docker): 1. Before the patch, I was able to successfully add a barcode with spaces after it, but got an error if there were spaces before it. 2. After the patch, things work as expected. 3. Also, not related to this bug, if you remove an item using the action from the table (instead of pasting a barcode into the barcode field), the "Remove item from collection" remains ticked. So another bug to create.
Created attachment 184647 [details] [review] Bug 31930: Ignore whitespace before and after barcodes Decoded the barcode in add items to collection. Test plan: 1. Go to Tools -> Rotating collections 2. Create a rotating collection 3. Chose Actions -> Manage items 4. Paste a barcode and put some spaces around it, for example " 39999000010053 " 5. Click Submit => Shown an error, no item with matching barcode found, though the barcode is printed without all the whitespace 6. Apply patch 7. Repeat steps 1 - 5, barcode should be accepted Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Nice work everyone! Pushed to main for 25.11
Nice work everyone! Pushed to 25.05.x