Bug 22098 - The stocknumberAV cataloguing plugin should be updated to use Koha::Objects
Summary: The stocknumberAV cataloguing plugin should be updated to use Koha::Objects
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Josef Moravec
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 22126
  Show dependency treegraph
 
Reported: 2019-01-11 09:24 UTC by Josef Moravec
Modified: 2020-11-30 21:49 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00
Circulation function:


Attachments
Bug 22098: Update stocknumberAV cataloguing plugin to use objects (3.91 KB, patch)
2019-01-11 09:33 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 22098: (follow-up) fix grammar/formating Perldoc (1.76 KB, patch)
2019-07-09 01:40 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 22098: Update stocknumberAV cataloguing plugin to use objects (3.97 KB, patch)
2020-03-21 11:57 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 22098: (follow-up) fix grammar/formating Perldoc (1.83 KB, patch)
2020-03-21 11:57 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 22098: Update stocknumberAV cataloguing plugin to use objects (4.03 KB, patch)
2020-03-22 14:08 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22098: Update stocknumberAV cataloguing plugin to use objects (4.03 KB, patch)
2020-03-22 14:10 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22098: (follow-up) fix grammar/formating Perldoc (1.88 KB, patch)
2020-03-22 14:10 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22098: (QA follow-up) Improving documentation (2.17 KB, patch)
2020-03-22 14:10 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Josef Moravec 2019-01-11 09:24:39 UTC
This plugin could be updated to use Koha::Object instead of SQL queries.
Comment 1 Josef Moravec 2019-01-11 09:33:38 UTC
Created attachment 83776 [details] [review]
Bug 22098: Update stocknumberAV cataloguing plugin to use objects

This patch:
- changes SQL to Koha::AuthorisedValues
- remove type param from script tag
- fixes the plugin description

0) Do not apply the patch
1) Set the plugin
1.1) Update a biblio framework and link plugin stocknumberAV.pl to some item
subfield
1.2) Add authorised values category called "INVENTORY"
1.3) Add some authorised values: authorised value is prefix and
description is a current stock/inventory number
2) Add an item and try to use this plugin to ensure you set it
correctly
2.1) Use a defined prefix to see if the number is correct
2.2) Ensure the number is correctly incremented in authorised values
2.3) Use not defined prefix to see the error message
2.4) Insert a not prefix string (eg number) to see it is not changed
3) Apply the patch
4) Repeat 2) and see it is working the same
5) Look into patch and confirm the description does make sense and is
rigth according to what you see in UI
6) Sign off :D
Comment 2 Mark Tompsett 2019-07-09 01:40:46 UTC
Created attachment 91421 [details] [review]
Bug 22098: (follow-up) fix grammar/formating Perldoc

- nubers => numbers
- some vertical spacing
- !}fmt -w65
- "contains of letters" => "containing letters"

TEST PLAN
---------
perldoc cataloguing/value_builder/stocknumberAV.pl
apply patch
perldoc cataloguing/value_builder/stocknumberAV.pl
-- after the patch is more readable.
Comment 3 Fridolin Somers 2020-03-21 11:57:07 UTC
Created attachment 101329 [details] [review]
Bug 22098: Update stocknumberAV cataloguing plugin to use objects

This patch:
- changes SQL to Koha::AuthorisedValues
- remove type param from script tag
- fixes the plugin description

0) Do not apply the patch
1) Set the plugin
1.1) Update a biblio framework and link plugin stocknumberAV.pl to some item
subfield
1.2) Add authorised values category called "INVENTORY"
1.3) Add some authorised values: authorised value is prefix and
description is a current stock/inventory number
2) Add an item and try to use this plugin to ensure you set it
correctly
2.1) Use a defined prefix to see if the number is correct
2.2) Ensure the number is correctly incremented in authorised values
2.3) Use not defined prefix to see the error message
2.4) Insert a not prefix string (eg number) to see it is not changed
3) Apply the patch
4) Repeat 2) and see it is working the same
5) Look into patch and confirm the description does make sense and is
rigth according to what you see in UI
6) Sign off :D

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 4 Fridolin Somers 2020-03-21 11:57:26 UTC
Created attachment 101330 [details] [review]
Bug 22098: (follow-up) fix grammar/formating Perldoc

- nubers => numbers
- some vertical spacing
- !}fmt -w65
- "contains of letters" => "containing letters"

TEST PLAN
---------
perldoc cataloguing/value_builder/stocknumberAV.pl
apply patch
perldoc cataloguing/value_builder/stocknumberAV.pl
-- after the patch is more readable.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Comment 5 Fridolin Somers 2020-03-21 11:59:36 UTC
Looks good, nice job
Comment 6 Katrin Fischer 2020-03-22 14:08:56 UTC
Created attachment 101373 [details] [review]
Bug 22098: Update stocknumberAV cataloguing plugin to use objects

This patch:
- changes SQL to Koha::AuthorisedValues
- remove type param from script tag
- fixes the plugin description

0) Do not apply the patch
1) Set the plugin
1.1) Update a biblio framework and link plugin stocknumberAV.pl to some item
subfield
1.2) Add authorised values category called "INVENTORY"
1.3) Add some authorised values: authorised value is prefix and
description is a current stock/inventory number
2) Add an item and try to use this plugin to ensure you set it
correctly
2.1) Use a defined prefix to see if the number is correct
2.2) Ensure the number is correctly incremented in authorised values
2.3) Use not defined prefix to see the error message
2.4) Insert a not prefix string (eg number) to see it is not changed
3) Apply the patch
4) Repeat 2) and see it is working the same
5) Look into patch and confirm the description does make sense and is
rigth according to what you see in UI
6) Sign off :D

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2020-03-22 14:10:07 UTC
Created attachment 101374 [details] [review]
Bug 22098: Update stocknumberAV cataloguing plugin to use objects

This patch:
- changes SQL to Koha::AuthorisedValues
- remove type param from script tag
- fixes the plugin description

0) Do not apply the patch
1) Set the plugin
1.1) Update a biblio framework and link plugin stocknumberAV.pl to some item
subfield
1.2) Add authorised values category called "INVENTORY"
1.3) Add some authorised values: authorised value is prefix and
description is a current stock/inventory number
2) Add an item and try to use this plugin to ensure you set it
correctly
2.1) Use a defined prefix to see if the number is correct
2.2) Ensure the number is correctly incremented in authorised values
2.3) Use not defined prefix to see the error message
2.4) Insert a not prefix string (eg number) to see it is not changed
3) Apply the patch
4) Repeat 2) and see it is working the same
5) Look into patch and confirm the description does make sense and is
rigth according to what you see in UI
6) Sign off :D

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Katrin Fischer 2020-03-22 14:10:11 UTC
Created attachment 101375 [details] [review]
Bug 22098: (follow-up) fix grammar/formating Perldoc

- nubers => numbers
- some vertical spacing
- !}fmt -w65
- "contains of letters" => "containing letters"

TEST PLAN
---------
perldoc cataloguing/value_builder/stocknumberAV.pl
apply patch
perldoc cataloguing/value_builder/stocknumberAV.pl
-- after the patch is more readable.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2020-03-22 14:10:15 UTC
Created attachment 101376 [details] [review]
Bug 22098: (QA follow-up) Improving documentation

Improves the documentation of the script a bit, but makes one
important change:

-If no prefix is submitted, or prefix does not contain only
-numbers, it returns the inserted code (= keep a field unchanged)
+If no prefix is submitted, or the prefix does contain only
+numbers, it returns the inserted code (= keep the field unchanged).

To test:
- Add an authorised INVENTORY value with 2020 as prefix
- After linking the stocknumberAV.pl to the 952$i in the frameworks
- Edit an item
- Add 2020 in the stocknumber field
- Trigger plugin
- Verify nothing happens

If the prefix contains only numbers... nothing happens.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Martin Renvoize (ashimema) 2020-03-24 11:05:08 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 11 Joy Nelson 2020-04-03 21:39:36 UTC
enhancement not backported to 19.11.x