Bug 32959 - Item templates will apply the same barcode each time template is applied if autobarcode is enabled
Summary: Item templates will apply the same barcode each time template is applied if a...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on: 24606
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-14 11:46 UTC by Kelly McElligott
Modified: 2023-12-28 20:47 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.07


Attachments
Bug 32959: Don't store results of autobarcode in item editor templates (2.33 KB, patch)
2023-02-14 13:55 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 32959: Don't store results of autobarcode in item editor templates (2.39 KB, patch)
2023-04-14 17:34 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 32959: Don't store results of autobarcode in item editor templates (2.39 KB, patch)
2023-05-04 20:05 UTC, Hinemoea Viault
Details | Diff | Splinter Review
Bug 32959: Don't store results of autobarcode in item editor templates (2.46 KB, patch)
2023-05-09 09:48 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kelly McElligott 2023-02-14 11:46:26 UTC
Item Templates will apply the same barcode each time template is applied if autobarcode is enabled

Test Plan:
1. Create item template, filling out the fields necessary.  
2. Koha will have created barcode to item, but remove.
3. Save the template.
4. Apply the template.
5 Koha will again but the barcode on the item.
6. Create second item, apply same template, Koha will use that same barcode to next item.
Comment 1 Kyle M Hall 2023-02-14 13:55:38 UTC
Created attachment 146615 [details] [review]
Bug 32959: Don't store results of autobarcode in item editor templates

Test Plan:
1) Enable autobarcode
2) Create a new item template, leave the barcode field blank
3) Apply that item template
4) Note the template prefills the barcode field
5) Delete that item template
6) Apply this patch
7) Restart all the things!
8) Repeat steps 2-4
9) Note the barcode field remains empty!
Comment 2 Phil Ringnalda 2023-04-14 17:34:27 UTC
Created attachment 149700 [details] [review]
Bug 32959: Don't store results of autobarcode in item editor templates

Test Plan:
1) Enable autobarcode
2) Create a new item template, leave the barcode field blank
3) Apply that item template
4) Note the template prefills the barcode field
5) Delete that item template
6) Apply this patch
7) Restart all the things!
8) Repeat steps 2-4
9) Note the barcode field remains empty!

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 3 Hinemoea Viault 2023-05-04 20:05:04 UTC
Created attachment 150694 [details] [review]
Bug 32959: Don't store results of autobarcode in item editor templates

Test Plan:
1) Enable autobarcode
2) Create a new item template, leave the barcode field blank
3) Apply that item template
4) Note the template prefills the barcode field
5) Delete that item template
6) Apply this patch
7) Restart all the things!
8) Repeat steps 2-4
9) Note the barcode field remains empty!

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Hinemoea Viault <hinemoea.viault@inlibro.com>
Comment 4 Jonathan Druart 2023-05-09 09:48:35 UTC
Created attachment 150832 [details] [review]
Bug 32959: Don't store results of autobarcode in item editor templates

Test Plan:
1) Enable autobarcode
2) Create a new item template, leave the barcode field blank
3) Apply that item template
4) Note the template prefills the barcode field
5) Delete that item template
6) Apply this patch
7) Restart all the things!
8) Repeat steps 2-4
9) Note the barcode field remains empty!

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Katrin Fischer 2023-05-09 10:02:10 UTC
Hm, looks like we overlapped, I was just writing this up:

I can't reproduce this error in master.

What I did:

* Activate Autobarcode, I chose YYYY-0001
* Create a new item, leave barcode empty, save as template
* Load the template = Barcode field is empty
* Crate a new item, generate barcode, empty field, save as template
* Load the template = Barcode field remains empty

The only way I can replicate is if the barcode field is filled in when I create the template.
Comment 6 Jonathan Druart 2023-05-09 10:11:56 UTC
You need autobarcode=incremental
Comment 7 Katrin Fischer 2023-05-09 11:42:13 UTC
(In reply to Jonathan Druart from comment #6)
> You need autobarcode=incremental

That was not in the test plan! (but glad we could clear it up)
Comment 8 Tomás Cohen Arazi 2023-05-18 14:35:51 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 9 Matt Blenkinsop 2023-06-08 16:51:42 UTC
Nice work everyone!

Pushed to stable for 22.11.x