Bug 35269 - Koha::Item->update_item_location should be named `trigger_location_update`
Summary: Koha::Item->update_item_location should be named `trigger_location_update`
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
: 35315 (view as bug list)
Depends on: 21159
Blocks: 35270
  Show dependency treegraph
 
Reported: 2023-11-06 14:38 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2024-07-04 20:38 UTC (History)
4 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:
23.11.00
Circulation function:


Attachments
Bug 35269: Rename `update_item_location` to `trigger_location_update` (3.89 KB, patch)
2023-11-06 15:06 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35269: Improve POD (964 bytes, patch)
2023-11-06 15:06 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35269: Rename `update_item_location` to `location_update_trigger` (3.89 KB, patch)
2023-11-06 18:33 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35269: Improve POD (964 bytes, patch)
2023-11-06 18:33 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 35269: Rename `update_item_location` to `location_update_trigger` (3.93 KB, patch)
2023-11-06 19:42 UTC, David Nind
Details | Diff | Splinter Review
Bug 35269: Improve POD (1010 bytes, patch)
2023-11-06 19:42 UTC, David Nind
Details | Diff | Splinter Review
Bug 35269: Rename `update_item_location` to `location_update_trigger` (3.99 KB, patch)
2023-11-06 19:50 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 35269: Improve POD (1.04 KB, patch)
2023-11-06 19:50 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 Tomás Cohen Arazi (tcohen) 2023-11-06 14:38:52 UTC

    
Comment 1 Tomás Cohen Arazi (tcohen) 2023-11-06 15:06:16 UTC
Created attachment 158535 [details] [review]
Bug 35269: Rename `update_item_location` to `trigger_location_update`

This patch renames all occurences of the method.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Tomás Cohen Arazi (tcohen) 2023-11-06 15:06:19 UTC
Created attachment 158536 [details] [review]
Bug 35269: Improve POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Tomás Cohen Arazi (tcohen) 2023-11-06 18:33:22 UTC
Created attachment 158540 [details] [review]
Bug 35269: Rename `update_item_location` to `location_update_trigger`

This patch renames all occurences of the method.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi (tcohen) 2023-11-06 18:33:25 UTC
Created attachment 158541 [details] [review]
Bug 35269: Improve POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 David Nind 2023-11-06 19:42:03 UTC
Created attachment 158548 [details] [review]
Bug 35269: Rename `update_item_location` to `location_update_trigger`

This patch renames all occurences of the method.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2023-11-06 19:42:06 UTC
Created attachment 158549 [details] [review]
Bug 35269: Improve POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2023-11-06 19:45:36 UTC
This is how I tested - hope this is sufficient!

1. Before applying the patch run git grep update_item_location - this was the result for me:

kohadev-koha@kohadevbox:koha(bz35269)$ git grep update_item_location
C4/Circulation.pm:            $item_object->update_item_location( 'checkout' );
C4/Circulation.pm:    my $loc_messages = $item->update_item_location( 'checkin' );
Koha/Item.pm:=head3 update_item_location
Koha/Item.pm:    $item->update_item_location( $action );
Koha/Item.pm:sub update_item_location {
t/db_dependent/Koha/Item.t:subtest 'update_item_location() tests' => sub {
t/db_dependent/Koha/Item.t:        $item->update_item_location($action);
t/db_dependent/Koha/Item.t:        $item->update_item_location($action);
t/db_dependent/Koha/Item.t:        $item->update_item_location($action);
t/db_dependent/Koha/Item.t:        $item->update_item_location($action);
t/db_dependent/Koha/Item.t:        $item->update_item_location($action);

2. After applying the patch, run again - there should be no results.

3. Test updating the shelving location on check in:
   3.1 Update the UpdateItemLocationOnCheckin system preference and add: _ALL_: FIC
   3.2 Check in an item (doesn't need to be checked out) - message should be similar to:
     39999000011418: Programming Perl /
     Not checked out.
     Item shelving location updated.
     Old value: General stacks
     New value: Fiction
   3.3 Confirm that the shelving location was updated to Fiction.

4. Test updating the shelving location on check out:
   4.1 Update the UpdateItemLocationOnCheckout system preference and add:  _ALL_: FIC
   4.2 Check out an item to a patron.
   4.3 Confirm that the shelving location was changed to Fiction.
Comment 8 Katrin Fischer 2023-11-06 19:50:22 UTC
Created attachment 158551 [details] [review]
Bug 35269: Rename `update_item_location` to `location_update_trigger`

This patch renames all occurences of the method.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Katrin Fischer 2023-11-06 19:50:25 UTC
Created attachment 158552 [details] [review]
Bug 35269: Improve POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Tomás Cohen Arazi (tcohen) 2023-11-08 13:00:18 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 11 Fridolin Somers 2023-11-10 07:58:33 UTC
Depends on Bug 21159 not in 23.05.x
Comment 12 Alex Buckley 2023-11-12 19:23:08 UTC
*** Bug 35315 has been marked as a duplicate of this bug. ***