[Bug 30328] New: Add ability to generate barcode with branch specific prefix
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Bug ID: 30328 Summary: Add ability to generate barcode with branch specific prefix Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: emmi.takkinen@koha-suomi.fi QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. For this we need to add new barcode option to syspref "autobarcode" and new systempreference where prefixes are set. -- 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=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |emmi.takkinen@koha-suomi.fi |ity.org | Status|NEW |ASSIGNED -- 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=30328 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=7676 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #1 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 132221 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132221&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyyyymmincr" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix Test plan: 1. Apply patch and update database 2. Set syspref "autoBarcode" as 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month>00001 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month>00002 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month>00001 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month>00001 9. Try to add multiple items => barcodes incremental value should increase in order (no skipping values, no errors) Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyyyymmincr.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132221|0 |1 is obsolete| | --- Comment #2 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 132954 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=132954&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyyyymmincr" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix Test plan: 1. Apply patch and update database 2. Set syspref "autoBarcode" as 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month>00001 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month>00002 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month>00001 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month>00001 9. Try to add multiple items => barcodes incremental value should increase in order (no skipping values, no errors) Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyyyymmincr.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #132954|0 |1 is obsolete| | --- Comment #3 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 134009 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134009&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyyyymmincr" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix Test plan for adding item: 1. Apply patch and update database 2. Set syspref "autoBarcode" as 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month>00001 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month>00002 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month>00001 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month>00001 9. Try to add multiple items => barcodes incremental value should increase in order (no skipping values, no errors) Test plan for adding multiple aqcuisitions: 1. Set syspref "AcqCreateItem" as "placing order". 2. Create an order and add multiple items to it. 3. Save the order. 4. Navigate to that biblios detail page to which you added items. => ordered items barcodes incremental value should increase in order (no skipping values, no errors) Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyyyymmincr.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #4 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Previous patch didn't have custom methods in C4/Barcodes/preyyyymmincr.pm so adding an order with multiple items produced error 500. Added methods and test plan for this scenario. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- I think the description of the BarcodePrefix preference should say that it is used in connection with the autoBarcode preference, and include a link to it (and vice versa). For example: "Define library specific barcode prefixes in YAML format. This defines the behavior of the <code><prefix>yyyymm0001</code> option of <a>autoBarcode</a>." And added to the autoBarcode description, "Define the behavior of the <code><prefix>yyyymm0001</code> option using <a>BarcodePrefix</a>." Should the BarcodePrefix preference provide an example for the syntax which is expected? Or perhaps a link to the wiki like OpacHiddenItems has? Otherwise everything was working well when tested in cataloging. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #6 from Owen Leonard <oleonard@myacpl.org> --- Also: The BarcodePrefix textarea should be a CodeMirror editor using "text/x-yaml" syntax. See OpacHiddenItems in opac.pref for example. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134009|0 |1 is obsolete| | --- Comment #7 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 134202 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134202&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyyyymmincr" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix Test plan for adding item: 1. Apply patch and update database 2. Set syspref "autoBarcode" as 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month>00001 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month>00002 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month>00001 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month>00001 9. Try to add multiple items => barcodes incremental value should increase in order (no skipping values, no errors) Test plan for adding multiple aqcuisitions: 1. Set syspref "AcqCreateItem" as "placing order". 2. Create an order and add multiple items to it. 3. Save the order. 4. Navigate to that biblios detail page to which you added items. => ordered items barcodes incremental value should increase in order (no skipping values, no errors) Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyyyymmincr.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #8 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Owen Leonard from comment #5)
I think the description of the BarcodePrefix preference should say that it is used in connection with the autoBarcode preference, and include a link to it (and vice versa). For example:
"Define library specific barcode prefixes in YAML format. This defines the behavior of the <code><prefix>yyyymm0001</code> option of <a>autoBarcode</a>."
And added to the autoBarcode description, "Define the behavior of the <code><prefix>yyyymm0001</code> option using <a>BarcodePrefix</a>."
Added links to descriptions and also changed BarcodePrefix as CodeMirror editor.
Should the BarcodePrefix preference provide an example for the syntax which is expected? Or perhaps a link to the wiki like OpacHiddenItems has?
Oh, I didn't notice this one. But I guess it would be more convenient to provide example on the sysprefs description rather than external wiki page. Something like "Syntax for barcodes is e.g. <code>DEF2022040001</code>". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134202|0 |1 is obsolete| | --- Comment #9 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 134206 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134206&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyyyymmincr" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix Test plan for adding item: 1. Apply patch and update database 2. Set syspref "autoBarcode" as 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month>00001 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month>00002 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month>00001 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month>00001 9. Try to add multiple items => barcodes incremental value should increase in order (no skipping values, no errors) Test plan for adding multiple aqcuisitions: 1. Set syspref "AcqCreateItem" as "placing order". 2. Create an order and add multiple items to it. 3. Save the order. 4. Navigate to that biblios detail page to which you added items. => ordered items barcodes incremental value should increase in order (no skipping values, no errors) Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyyyymmincr.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #10 from Owen Leonard <oleonard@myacpl.org> --- I'm getting an error when I try to use the "Add multiple copies" option: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data too long for column 'barcode' at row 1 at /kohadevbox/koha/Koha/Object.pm line 170 at /usr/share/perl5/DBIx/Class/Exception.pm line 77 I'm not sure why this happened--it wasn't because I'd added a prefix which would cause the barcode to be too long. However, it does highlight that it is a possibility: If someone uses a prefix 10 characters long the barcode will always exceed the size of items.barcode. It also occurs to me... Shouldn't the prefix be determined by the item's home library, not by the user's logged-in library? In our system, for instance, cataloging for all the branches is done at one location. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |ASSIGNED --- Comment #11 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Owen Leonard from comment #10)
I'm getting an error when I try to use the "Add multiple copies" option:
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data too long for column 'barcode' at row 1 at /kohadevbox/koha/Koha/Object.pm line 170 at /usr/share/perl5/DBIx/Class/Exception.pm line 77
I'm not sure why this happened--it wasn't because I'd added a prefix which would cause the barcode to be too long. However, it does highlight that it is a possibility: If someone uses a prefix 10 characters long the barcode will always exceed the size of items.barcode.
Last changes which fixed ability to add multiple aqcuisitions items, broke the ability to add multiple items. Will fix it asap.
It also occurs to me... Shouldn't the prefix be determined by the item's home library, not by the user's logged-in library? In our system, for instance, cataloging for all the branches is done at one location.
This sure doesn't take that possibility into account. I'll take a look at this also. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #134206|0 |1 is obsolete| | --- Comment #12 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 139350 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139350&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyyyymmincr" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix Test plan for adding item: 1. Apply patch and update database 2. Set syspref "autoBarcode" as 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month>00001 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month>00002 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month>00001 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month>00001 9. Try to add multiple items => barcodes incremental value should increase in order (no skipping values, no errors) Test plan for adding multiple aqcuisitions: 1. Set syspref "AcqCreateItem" as "placing order". 2. Create an order and add multiple items to it. 3. Save the order. 4. Navigate to that biblios detail page to which you added items. => ordered items barcodes incremental value should increase in order (no skipping values, no errors) Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyyyymmincr.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #13 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Fixed adding multiple items. Still thinking if we really can use items home library to determine barcode prefix. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #14 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Emmi Takkinen from comment #13)
Fixed adding multiple items. Still thinking if we really can use items home library to determine barcode prefix.
There are plugin hooks for barcodes now: https://github.com/bywatersolutions/dev-koha-plugin-kitchen-sink/commit/0ee1... And we have a plugin for prefixing barcodes with library prefixes: https://github.com/bywatersolutions/koha-plugin-barcode-prefixer Just mentioning as that may work for this case -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Add ability to generate |Add ability to generate |barcode with branch |barcode with library |specific prefix |specific prefix --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- What is the status of this? Emmi, did you decide to use the plugin? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #16 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Katrin Fischer from comment #15)
What is the status of this? Emmi, did you decide to use the plugin?
We tested it and unfortunately it doesn't fit our workflow :( I haven't been able to work with this for a while but I'm determined to finally catch up with all my assigned bugs which have been left hanging :D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Emmi Takkinen from comment #16)
(In reply to Katrin Fischer from comment #15)
What is the status of this? Emmi, did you decide to use the plugin?
We tested it and unfortunately it doesn't fit our workflow :(
I haven't been able to work with this for a while but I'm determined to finally catch up with all my assigned bugs which have been left hanging :D
Happy to hear that :) Going into summer in this part of the world we are always lacking hands (with the people attached to them). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #18 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- There are couple problems here. First, if incremental part of barcode is generated by fetching max value from last added item, there is a change that a duplicate barcode is generated. Using timestamp (yyyymmddHHMMSS) would probably be an usable solution here, but we haven't tested this yet. Second is getting items home library. This requires creating an AJAX call, which isn't problem itself. Problem is that Kohas way of generating barcodes is... interesting. And complex. I tested this a little while ago and using AJAX call advanced incremental part of barcode by 2 or even more. Which can cause issues in large libraries when limit of monthly increment parts is filled before end of month. But again, using timestamp could be useful here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139350|0 |1 is obsolete| | --- Comment #19 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 187145 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187145&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyymmddts" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix. Test plan: 1. Apply patch and update database 2. Set syspref "autoBarcode" as "preyymmddts" 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month><current_day><timestamp> 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month><current_day><timestamp> 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month><current_day><timestamp> 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month><current_day><timestamp> 9. Try to add multiple items => barcodes timestamp value should change based on time barcode was generated. Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyymmddts.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187145|0 |1 is obsolete| | --- Comment #20 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 187146 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187146&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyymmddts" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix. Test plan: 1. Apply patch and update database 2. Set syspref "autoBarcode" as "preyymmddts" 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month><current_day><timestamp> 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month><current_day><timestamp> 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month><current_day><timestamp> 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month><current_day><timestamp> 9. Try to add multiple items => barcodes timestamp value should change based on time barcode was generated. Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyymmddts.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #21 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- This now uses timestamp instead of incremental value. Qa-tools complains about not-tidy files [FAIL] cataloguing/additem.pl SKIP spelling FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl cataloguing/additem.pl` [FAIL] cataloguing/value_builder/barcode.pl SKIP spelling FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl cataloguing/value_builder/barcode.pl` [FAIL] cataloguing/value_builder/barcode_manual.pl SKIP spelling FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl cataloguing/value_builder/barcode_manual.pl` but when I run tidy.pl it fixes lines which (as far as I can tell) are already tidy. Complains are all about space between use function and qw (e.g. use Encode qw( encode_utf8 )) qa-tools wants one space there but shouldn't they be aligned with other qws? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187146|0 |1 is obsolete| | --- Comment #22 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 187902 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=187902&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyymmddts" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix. Test plan: 1. Apply patch and update database 2. Set syspref "autoBarcode" as "preyymmddts" 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month><current_day><timestamp> 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month><current_day><timestamp> 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month><current_day><timestamp> 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month><current_day><timestamp> 9. Try to add multiple items => barcodes timestamp value should change based on time barcode was generated. Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyymmddts.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #23 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Fixed a typo. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Esther Melander <esther.melander@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |esther.melander@bywatersolu | |tions.com --- Comment #24 from Esther Melander <esther.melander@bywatersolutions.com> --- *** Bug 35897 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #25 from Owen Leonard <oleonard@myacpl.org> --- Some complaints from the qa tools: [FAIL] C4/Barcodes/ValueBuilder.pm SKIP pod_coverage No POD exists FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl C4/Barcodes/ValueBuilder.pm` [FAIL] C4/Barcodes/preyymmddts.pm FAIL forbidden_patterns forbidden pattern: Use https:// instead of http:// for URLs (line 18) SKIP pod_coverage No POD exists FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl C4/Barcodes/preyymmddts.pm` -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #26 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Owen Leonard from comment #25)
Some complaints from the qa tools:
[FAIL] C4/Barcodes/ValueBuilder.pm SKIP pod_coverage No POD exists FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl C4/Barcodes/ValueBuilder.pm` [FAIL] C4/Barcodes/preyymmddts.pm FAIL forbidden_patterns forbidden pattern: Use https:// instead of http:// for URLs (line 18) SKIP pod_coverage No POD exists FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl C4/Barcodes/preyymmddts.pm`
Hmm, I used the new perl-qa-tools and got sligthly different report from it: Result: [PASS] C4/Barcodes.pm SKIP spelling [SKIP] C4/Barcodes/ValueBuilder.pm SKIP pod_coverage No POD exists SKIP spelling [SKIP] C4/Barcodes/preyymmddts.pm SKIP pod_coverage No POD exists SKIP spelling [FAIL] cataloguing/additem.pl SKIP spelling FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl cataloguing/additem.pl` [FAIL] cataloguing/value_builder/barcode.pl SKIP spelling FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl cataloguing/value_builder/barcode.pl` [FAIL] cataloguing/value_builder/barcode_manual.pl SKIP spelling FAIL tidiness File is not tidy, please run `perl misc/devel/tidy.pl cataloguing/value_builder/barcode_manual.pl` [PASS] installer/data/mysql/atomicupdate/bug_30328.pl SKIP spelling [PASS] installer/data/mysql/mandatory/sysprefs.sql [PASS] koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref [PASS] t/Barcodes_preyymmddts.t SKIP spelling [PASS] t/db_dependent/Barcodes_ValueBuilder.t SKIP spelling Processing additional checks PASS! * Have you considered sharing the new syspref to HEA? (see bug 23849 and C4/UsageStats.pm) Running tests (2) * Proving /home/emmi/Koha/t/Barcodes_preyymmddts.t PASS * Proving /home/emmi/Koha/t/db_dependent/Barcodes_ValueBuilder.t PASS Tidiness issues all come from package imports, tool suggests that there should only be a single space between package name and qw so that this use Encode qw( encode_utf8 ); use List::MoreUtils qw( any uniq ); becomes this use Encode qw( encode_utf8 ); use List::MoreUtils qw( any uniq ); But lining the qw's seems to be intentional (see e.g. Bug 36498 tidy commit), so maybe those can be ignored? Also new qa-tool doesn't report any issues in C4/Barcodes/ValueBuilder.pm and misses the forbidden pattern in URL. I'll try to run this through old qa-tool to see if ValueBuilder.pm has any other issues than package imports. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #27 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> ---
new perl-qa-tools
Ignore this, confused this with new bz tool which uses perl. Although my point still stands, my version of qa-tools doesn't report same things as older version of it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #187902|0 |1 is obsolete| | --- Comment #28 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 191775 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191775&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyymmddts" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix. Test plan: 1. Apply patch and update database 2. Set syspref "autoBarcode" as "preyymmddts" 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month><current_day><timestamp> 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month><current_day><timestamp> 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month><current_day><timestamp> 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month><current_day><timestamp> 9. Try to add multiple items => barcodes timestamp value should change based on time barcode was generated. Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyymmddts.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #29 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Fixed forbidden URL, left files less tidy since I'm unsure should the space between package and qw be single or inline with next line. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #30 from Owen Leonard <oleonard@myacpl.org> --- The QA tool still complains about a few things that I think can be fixed. I assume the question about the space would be to follow whatever the tidy script says? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #31 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to Owen Leonard from comment #30)
The QA tool still complains about a few things that I think can be fixed. I assume the question about the space would be to follow whatever the tidy script says?
I guess that's the best approach at this point. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191775|0 |1 is obsolete| | --- Comment #32 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 194375 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194375&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyymmddts" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix. Test plan: 1. Apply patch and update database 2. Set syspref "autoBarcode" as "preyymmddts" 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month><current_day><timestamp> 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month><current_day><timestamp> 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month><current_day><timestamp> 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month><current_day><timestamp> 9. Try to add multiple items => barcodes timestamp value should change based on time barcode was generated. Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyymmddts.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #33 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Tidied code to make qa-tool happy. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 holly@bywatersolutions.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |holly@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |david@davidnind.com --- Comment #34 from David Nind <david@davidnind.com> --- The patch no longer applies 8-(... git bz apply 30328 📋 Bug 30328 - Add ability to generate barcode with library specific prefix • 194375 - Bug 30328: Add ability to generate barcode with branch specific prefix Apply? [(y)es, (n)o, (i)nteractive] y Preparing 1 patch(es): ✓ Prepared 1 patch(es) Applying 1 patch(es): Patch application failed for attachment 194375 - Bug 30328: Add ability to generate barcode with branch specific prefix Patches left in /tmp/9oBfpGft14 for manual application if needed To resolve: 1. Fix conflicts (use 'git mergetool' or edit files manually) 2. Stage resolved files with 'git add' 3. Continue with 'git bz apply --continue' or 'git am --continue' 4. Or skip this patch with 'git bz apply --skip' 5. Or abort with 'git bz apply --abort' Error: Apply failed: Git command (git am -3 /tmp/9oBfpGft14/0001-194375.patch) failed: error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194375|0 |1 is obsolete| | --- Comment #35 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 197855 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197855&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyymmddts" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix. Test plan: 1. Apply patch and update database 2. Set syspref "autoBarcode" as "preyymmddts" 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month><current_day><timestamp> 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month><current_day><timestamp> 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month><current_day><timestamp> 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month><current_day><timestamp> 9. Try to add multiple items => barcodes timestamp value should change based on time barcode was generated. Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyymmddts.t Sponsored-by: Koha-Suomi Oy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #36 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Rebased patches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Sponsorship status|--- |Sponsored Comma delimited| |Koha-Suomi Oy list of Sponsors| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197855|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=30328 --- Comment #37 from David Nind <david@davidnind.com> --- Created attachment 197945 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197945&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyymmddts" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix. Test plan: 1. Apply patch and update database 2. Set syspref "autoBarcode" as "preyymmddts" 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month><current_day><timestamp> 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month><current_day><timestamp> 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month><current_day><timestamp> 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month><current_day><timestamp> 9. Try to add multiple items => barcodes timestamp value should change based on time barcode was generated. Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyymmddts.t Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement lets you release notes| |generate barcodes with a | |library specific prefix. | | | |The autoBarcode system | |preference has a new | |option, "generated in the | |form | |<prefix>yymmdd<timestamp>" | |(preyymmddts). | | | |The new BarcodePrefix | |system preference lets you | |define the prefixes to use, | |using YAML. For example: | | | | Default: DEF | | CPL: CPL | | FFL: FFL --- Comment #38 from David Nind <david@davidnind.com> --- In the new system preference, "Define branch specific barcode ..." should be "Define library specific...". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197945|0 |1 is obsolete| | --- Comment #39 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 197952 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197952&action=edit Bug 30328: Add ability to generate barcode with branch specific prefix We should add more flexibility to generating barcodes by letting libraries define branch specific prefix for their barcodes. This patch adds new option "preyymmddts" in systempreference "autoBarcode" and new systempreference "BarcodePrefix" to define branch specific prefix. Test plan: 1. Apply patch and update database 2. Set syspref "autoBarcode" as "preyymmddts" 3. Add some values to syspref "Barcodeprefix" e.g.: Default: DEF CPL: CPL FFL: FFL 4. Now change your library to CPL (if needed) and add an item 5. Click barcode input field => barcode should be CPL<current_year><current_month><current_day><timestamp> 6. Add another item and click barcode field => barcode should be CPL<current_year><current_month><current_day><timestamp> 7. Change your library to FFL and add an item => barcode should now be FFL<current_year><current_month><current_day><timestamp> 8. Change your library to e.g. FPL (or another as long as it doesn't have prefix value in "Barcodeprefix"), add an item and click barcode field => barcode should now be DEF<current_year><current_month><current_day><timestamp> 9. Try to add multiple items => barcodes timestamp value should change based on time barcode was generated. Also prove t/db_dependent/Barcodes_ValueBuilder.t and t/Barcodes_preyymmddts.t Sponsored-by: Koha-Suomi Oy Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #40 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- (In reply to David Nind from comment #38)
In the new system preference, "Define branch specific barcode ..." should be "Define library specific...".
Term is now changed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30328 --- Comment #41 from David Nind <david@davidnind.com> --- (In reply to Emmi Takkinen from comment #40)
(In reply to David Nind from comment #38)
In the new system preference, "Define branch specific barcode ..." should be "Define library specific...".
Term is now changed.
Thanks! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org