[Bug 22996] New: Move barcode separators to a preference
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Bug ID: 22996 Summary: Move barcode separators to a preference Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org Target Milestone: --- -- 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=22996 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | Patch complexity|--- |Small patch -- 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=22996 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 90155 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90155&action=edit Bug 22996: Add new preference BarcodeSeparators Test plan: Run new install or upgrade. Check pref value. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 90156 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90156&action=edit Bug 22996: Move barcode separators to a preference This patch makes batchMod.pl and inventory.pl pick the barcode separators from a new pref BarcodeSeparators (instead of hardcoding these separators differently). A few other code locations may be potential candidates for such a change too. Test plan: Test inventory with a few variations of BarcodeSeparators. Test Batch item modification similarly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I think the separator should be selected from the interface, it depends on user's preference. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #3)
I think the separator should be selected from the interface, it depends on user's preference.
Not sure if that would be really relevant, since the barcodes belong to one system. But yes, it could be done, perhaps with the pref as default value. But I am suggesting to open a new report for that enhancement. The focus of this development is consolidation of the approach in inventory and batchmod. Possible candidates for future extension: circ/circulation.pl: push @$barcodes, split( /\s\n/, $list ); circ/circulation.pl: foreach my $barcode ( sort split(/\s*\|\s*/, $chosen->{barcode}) ) { course_reserves/batch_add_items.pl: my @barcodes = uniq( split( /\s\n/, $barcodes ) ); svc/letters/preview: my ( $barcode, $borrowernumber ) = split '\|', $data_preview; tools/stockrotation.pl: my @data = split(/\n/, $barcode); virtualshelves/shelves.pl: my @barcodes = split /\n/, $barcodes; # Entries are effectively passed in as a <cr> separated list -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=22996 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #90155|0 |1 is obsolete| | Attachment #90156|0 |1 is obsolete| | --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 90185 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90185&action=edit Bug 22996: Add new preference BarcodeSeparators The pref value is used within a regex character class like [pref]. This means that we should precede hyphen with a backslash; the pipe char or dot does not need escaping. Test plan: Run new install or upgrade. Check pref value. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 90186 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=90186&action=edit Bug 22996: Move barcode separators to a preference This patch makes batchMod.pl and inventory.pl pick the barcode separators from a new pref BarcodeSeparators (instead of hardcoding these separators differently). A few other code locations may be potential candidates for such a change too. Test plan: Test inventory with a few variations of BarcodeSeparators. Test Batch item modification similarly. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=19585 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |Adds preference release notes| |BarcodeSeparators. | |NOTE: If | |you currently depend on | |comma, semicolon, pipe char | |or hyphen as a barcode | |separator within inventory | |tool, please ADD them to | |this new preference. The | |default behavior is set | |back to carriage return, | |linefeed or whitespace now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #90185|0 |1 is obsolete| | Attachment #90186|0 |1 is obsolete| | --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 92636 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92636&action=edit Bug 22996: Add new preference BarcodeSeparators The pref value is used within a regex character class like [pref]. This means that we should precede hyphen with a backslash; the pipe char or dot does not need escaping. Test plan: Run new install or upgrade. Check pref value. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 92637 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92637&action=edit Bug 22996: Move barcode separators to a preference This patch makes batchMod.pl and inventory.pl pick the barcode separators from a new pref BarcodeSeparators (instead of hardcoding these separators differently). A few other code locations may be potential candidates for such a change too. Test plan: Test inventory with a few variations of BarcodeSeparators. Test Batch item modification similarly. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.com |y.org | CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Marcel, depending on the flexibility we want, I would suggest we use a different approach (less permissive): Barcode separator characters: - - Use the following characters as barcode separators: - pref: BarcodeSeparators choices: '\s': space '\t': tab .. Willing to PQA on this one as a first step, but would like your opinion. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #9)
Marcel, depending on the flexibility we want, I would suggest we use a different approach (less permissive):
Barcode separator characters: - - Use the following characters as barcode separators: - pref: BarcodeSeparators choices: '\s': space '\t': tab ..
Willing to PQA on this one as a first step, but would like your opinion.
The default is whitespace, LF or CR. Almost as restrictive as yours ;) The inventory script already had: /[\n\r,;|-]/ So I think the current approach allows for all tastes. Why cut in flexibility? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #10)
(In reply to Tomás Cohen Arazi from comment #9)
Marcel, depending on the flexibility we want, I would suggest we use a different approach (less permissive):
Barcode separator characters: - - Use the following characters as barcode separators: - pref: BarcodeSeparators choices: '\s': space '\t': tab ..
Willing to PQA on this one as a first step, but would like your opinion.
The default is whitespace, LF or CR. Almost as restrictive as yours ;) The inventory script already had: /[\n\r,;|-]/ So I think the current approach allows for all tastes. Why cut in flexibility?
I hate error prone (typo) configurations, but hey, this is an enhancement to the currently hardcoded stuff. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Marcel de Rooy from comment #10)
(In reply to Tomás Cohen Arazi from comment #9)
Marcel, depending on the flexibility we want, I would suggest we use a different approach (less permissive):
Barcode separator characters: - - Use the following characters as barcode separators: - pref: BarcodeSeparators choices: '\s': space '\t': tab ..
Willing to PQA on this one as a first step, but would like your opinion.
The default is whitespace, LF or CR. Almost as restrictive as yours ;) The inventory script already had: /[\n\r,;|-]/ So I think the current approach allows for all tastes. Why cut in flexibility?
Would you object to makes this a YAML list so no 'split' is required on the controllers? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #92636|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=22996 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #92637|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=22996 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 92668 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92668&action=edit Bug 22996: Add new preference BarcodeSeparators The pref value is used within a regex character class like [pref]. This means that we should precede hyphen with a backslash; the pipe char or dot does not need escaping. Test plan: Run new install or upgrade. Check pref value. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 92669 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=92669&action=edit Bug 22996: Move barcode separators to a preference This patch makes batchMod.pl and inventory.pl pick the barcode separators from a new pref BarcodeSeparators (instead of hardcoding these separators differently). A few other code locations may be potential candidates for such a change too. Test plan: Test inventory with a few variations of BarcodeSeparators. Test Batch item modification similarly. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |19.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Tomás Cohen Arazi from comment #12)
Would you object to makes this a YAML list so no 'split' is required on the controllers?
Thx Tomas. Sure, no objection. Open up a new report and show what you mean. I will be happy to sign off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=23580 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED CC| |fridolin.somers@biblibre.co | |m --- Comment #17 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Enhancement not pushed to 19.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=23254 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22996 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Text to go in the|Adds preference |Adds preference release notes|BarcodeSeparators. |`BarcodeSeparators` |NOTE: If | |you currently depend on |**NOTE**: If you currently |comma, semicolon, pipe char |depend on a comma, |or hyphen as a barcode |semicolon, pipe character |separator within inventory |or hyphen as a barcode |tool, please ADD them to |separator within inventory |this new preference. The |tool, please ADD them to |default behavior is set |this new preference. The |back to carriage return, |default behaviour is set |linefeed or whitespace now. |back to a carriage return, | |linefeed or whitespace now. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org