Bugzilla – Attachment 158535 Details for
Bug 35269
Koha::Item->update_item_location should be named `trigger_location_update`
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35269: Rename `update_item_location` to `trigger_location_update`
Bug-35269-Rename-updateitemlocation-to-triggerloca.patch (text/plain), 3.89 KB, created by
Tomás Cohen Arazi (tcohen)
on 2023-11-06 15:06:16 UTC
(
hide
)
Description:
Bug 35269: Rename `update_item_location` to `trigger_location_update`
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2023-11-06 15:06:16 UTC
Size:
3.89 KB
patch
obsolete
>From 6ae9cad91a43902863e1a29a679fccd73e1e3acf Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 6 Nov 2023 11:53:53 -0300 >Subject: [PATCH] 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> >--- > C4/Circulation.pm | 4 ++-- > Koha/Item.pm | 6 +++--- > t/db_dependent/Koha/Item.t | 12 ++++++------ > 3 files changed, 11 insertions(+), 11 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 3d4a3efa906..1fc944b0534 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1728,7 +1728,7 @@ sub AddIssue { > } > > # Update item location >- $item_object->update_item_location( 'checkout' ); >+ $item_object->trigger_location_update( 'checkout' ); > > if ( C4::Context->preference('UpdateTotalIssuesOnCirc') ) { > UpdateTotalIssues( $item_object->biblionumber, 1, undef, { skip_holds_queue => 1 } ); >@@ -2199,7 +2199,7 @@ sub AddReturn { > my $patron_unblessed = $patron ? $patron->unblessed : {}; > > # Update item location >- my $loc_messages = $item->update_item_location( 'checkin' ); >+ my $loc_messages = $item->trigger_location_update( 'checkin' ); > foreach my $loc_msg_key ( keys %$loc_messages ) { > $messages->{ $loc_msg_key } = $loc_messages->{ $loc_msg_key }; > } >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 2b6f0a2a376..3b5199e6682 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -2356,15 +2356,15 @@ sub strings_map { > } > > >-=head3 update_item_location >+=head3 trigger_location_update > >- $item->update_item_location( $action ); >+ $item->trigger_location_update( $action ); > > Update the item location on checkin or checkout. > > =cut > >-sub update_item_location { >+sub trigger_location_update { > my ( $self, $action ) = @_; > > my ( $update_loc_rules, $messages ); >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index fdce202767b..3ecc8c303a6 100755 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -2302,7 +2302,7 @@ subtest 'current_branchtransfers relationship' => sub { > $schema->storage->txn_rollback; > }; > >-subtest 'update_item_location() tests' => sub { >+subtest 'trigger_location_update() tests' => sub { > > plan tests => 10; > >@@ -2320,26 +2320,26 @@ subtest 'update_item_location() tests' => sub { > > my $item = $builder->build_sample_item( { location => $location, permanent_location => $permanent_location } ); > >- $item->update_item_location($action); >+ $item->trigger_location_update($action); > > is( $item->location, $location, "$pref does not modify value when not enabled" ); > > t::lib::Mocks::mock_preference( $pref, qq{$location: GEN} ); > >- $item->update_item_location($action); >+ $item->trigger_location_update($action); > > is( $item->location, 'GEN', qq{'location' value set from '$location' to 'GEN' with setting `$location: GEN`} ); > > t::lib::Mocks::mock_preference( $pref, q{_ALL_: BOO} ); > >- $item->update_item_location($action); >+ $item->trigger_location_update($action); > > is( $item->location, 'BOO', q{`_ALL_` does the job} ); > > t::lib::Mocks::mock_preference( $pref, qq{$location: _BLANK_} ); > $item->location($location)->store(); > >- $item->update_item_location($action); >+ $item->trigger_location_update($action); > is( $item->location, q{}, q{`_BLANK_` does the job} ); > > t::lib::Mocks::mock_preference( $pref, qq{GEN: _BLANK_\n_BLANK_: PROC\n$location: _PERM_} ); >@@ -2352,7 +2352,7 @@ subtest 'update_item_location() tests' => sub { > } > )->store; > >- $item->update_item_location($action); >+ $item->trigger_location_update($action); > > is( > $item->location, $permanent_location, >-- >2.42.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35269
:
158535
|
158536
|
158540
|
158541
|
158548
|
158549
|
158551
|
158552