Bug 29809 - StockRotationItems->itemnumber is poorly named
Summary: StockRotationItems->itemnumber is poorly named
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-06 12:45 UTC by Nick Clemens
Modified: 2022-02-24 22:35 UTC (History)
4 users (show)

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


Attachments
Bug 29809: Rename item relation accessor from itemnumber (23.67 KB, patch)
2022-01-06 14:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29809: Update stockration tool to reflect method name change (7.74 KB, patch)
2022-01-06 14:05 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29809: Rename item relation accessor from itemnumber (23.77 KB, patch)
2022-01-18 12:00 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 29809: Update stockration tool to reflect method name change (7.79 KB, patch)
2022-01-18 12:00 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 29809: (follow-up) Update tests and rename variable (3.01 KB, patch)
2022-01-18 12:01 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 29809: Rename item relation accessor from itemnumber (23.85 KB, patch)
2022-01-27 16:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29809: Update stockration tool to reflect method name change (7.87 KB, patch)
2022-01-27 16:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29809: (follow-up) Update tests and rename variable (3.09 KB, patch)
2022-01-27 16:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29809: Fix StockRotationStages.t (1.29 KB, patch)
2022-01-27 16:15 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 Nick Clemens 2022-01-06 12:45:22 UTC
This subroutine returns a Koha::Item object - not an itemnumber

Leads to fun lines of code like:
$sr_item->itemnumber->itemnumber
Comment 1 Martin Renvoize 2022-01-06 14:05:41 UTC
Created attachment 129086 [details] [review]
Bug 29809: Rename item relation accessor from itemnumber

This patch renames the item relation accessor method in
StockRotationItem to 'item' from 'itemnumber' to more clearly reflect
that the method returns a Koha::Item object and not an itemnumber.
Comment 2 Martin Renvoize 2022-01-06 14:05:45 UTC
Created attachment 129087 [details] [review]
Bug 29809: Update stockration tool to reflect method name change
Comment 3 Martin Renvoize 2022-01-06 14:06:19 UTC
Hopefully that catches all spots
Comment 4 Katrin Fischer 2022-01-08 21:52:45 UTC
Hi Nick, you accidentally attached patches to bug 28909 - including a follow-up with a typo in the bug number. Can you please check? 

I have fixed the attachments on the other bug.
Comment 5 Nick Clemens 2022-01-18 12:00:54 UTC
Created attachment 129548 [details] [review]
Bug 29809: Rename item relation accessor from itemnumber

This patch renames the item relation accessor method in
StockRotationItem to 'item' from 'itemnumber' to more clearly reflect
that the method returns a Koha::Item object and not an itemnumber.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Nick Clemens 2022-01-18 12:00:57 UTC
Created attachment 129549 [details] [review]
Bug 29809: Update stockration tool to reflect method name change

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Nick Clemens 2022-01-18 12:01:00 UTC
Created attachment 129550 [details] [review]
Bug 29809: (follow-up) Update tests and rename variable

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 8 Jonathan Druart 2022-01-27 16:15:12 UTC
Created attachment 129901 [details] [review]
Bug 29809: Rename item relation accessor from itemnumber

This patch renames the item relation accessor method in
StockRotationItem to 'item' from 'itemnumber' to more clearly reflect
that the method returns a Koha::Item object and not an itemnumber.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2022-01-27 16:15:17 UTC
Created attachment 129902 [details] [review]
Bug 29809: Update stockration tool to reflect method name change

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2022-01-27 16:15:21 UTC
Created attachment 129903 [details] [review]
Bug 29809: (follow-up) Update tests and rename variable

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2022-01-27 16:15:26 UTC
Created attachment 129904 [details] [review]
Bug 29809: Fix StockRotationStages.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Fridolin Somers 2022-02-01 07:57:14 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 13 Kyle M Hall 2022-02-07 16:51:00 UTC
Pushed to 21.11.x for 21.11.03
Comment 14 Andrew Fuerste-Henry 2022-02-21 15:46:14 UTC
Pushed to 21.05.x for 21.05.11
Comment 15 Victor Grousset/tuxayo 2022-02-24 22:35:32 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.