Bugzilla – Attachment 182873 Details for
Bug 39145
Differentiate between deleting or transferring public and shared lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39145: (follow-up) Tidy files
Bug-39145-follow-up-Tidy-files.patch (text/plain), 4.17 KB, created by
David Nind
on 2025-05-31 03:15:52 UTC
(
hide
)
Description:
Bug 39145: (follow-up) Tidy files
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-05-31 03:15:52 UTC
Size:
4.17 KB
patch
obsolete
>From 92814ad9a2cd8ef0bb505e63c0d60066e1b46a39 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 30 May 2025 08:27:12 +0200 >Subject: [PATCH] Bug 39145: (follow-up) Tidy files > >No test plan (just result of perltidy). > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Virtualshelves.pm | 4 ++-- > installer/data/mysql/atomicupdate/bug_39145.pl | 6 ++++-- > t/db_dependent/Koha/Virtualshelves.t | 11 +++++------ > 3 files changed, 11 insertions(+), 10 deletions(-) > >diff --git a/Koha/Virtualshelves.pm b/Koha/Virtualshelves.pm >index e1687b1d73..d32776b5f6 100644 >--- a/Koha/Virtualshelves.pm >+++ b/Koha/Virtualshelves.pm >@@ -48,7 +48,7 @@ sub disown_or_delete { > my $list_pref = C4::Context->preference('ListOwnershipUponPatronDeletion'); > $self->_resultset->result_source->schema->txn_do( > sub { >- if ( $list_pref ne 'delete' ) { # transfer or transfer_public >+ if ( $list_pref ne 'delete' ) { # transfer or transfer_public > my $new_owner; > > $new_owner = C4::Context->preference('ListOwnerDesignated') >@@ -64,7 +64,7 @@ sub disown_or_delete { > $list->transfer_ownership($new_owner); > } elsif ( $new_owner && $list->is_shared && $list_pref eq 'transfer' ) { > $list->transfer_ownership($new_owner); >- } else { # private list, or shared list with transfer_public >+ } else { # private list, or shared list with transfer_public > $list->delete; > } > } >diff --git a/installer/data/mysql/atomicupdate/bug_39145.pl b/installer/data/mysql/atomicupdate/bug_39145.pl >index 943636a1b0..73a19cc102 100755 >--- a/installer/data/mysql/atomicupdate/bug_39145.pl >+++ b/installer/data/mysql/atomicupdate/bug_39145.pl >@@ -8,9 +8,11 @@ return { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; > >- $dbh->do(q{ >+ $dbh->do( >+ q{ > UPDATE systempreferences SET options='delete|transfer|transfer_public' WHERE variable = 'ListOwnershipUponPatronDeletion' >- }); >+ } >+ ); > say $out "Updated system preference 'ListOwnershipUponPatronDeletion'"; > }, > }; >diff --git a/t/db_dependent/Koha/Virtualshelves.t b/t/db_dependent/Koha/Virtualshelves.t >index 6f6caae1bc..1c8ca1275c 100755 >--- a/t/db_dependent/Koha/Virtualshelves.t >+++ b/t/db_dependent/Koha/Virtualshelves.t >@@ -175,9 +175,9 @@ subtest 'disown_or_delete() tests' => sub { > subtest 'ListOwnershipUponPatronDeletion set to transfer_public' => sub { > plan tests => 2; > $schema->storage->txn_begin; >- my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } ); >- my $patron_2 = $builder->build_object( { class => 'Koha::Patrons' } ); >- my $patron_3 = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $patron_2 = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $patron_3 = $builder->build_object( { class => 'Koha::Patrons' } ); > my $public_list = $builder->build_object( > { > class => "Koha::Virtualshelves", >@@ -201,13 +201,12 @@ subtest 'disown_or_delete() tests' => sub { > t::lib::Mocks::mock_preference( 'ListOwnershipUponPatronDeletion', 'transfer_public' ); > t::lib::Mocks::mock_preference( 'ListOwnerDesignated', $patron_3->id ); > >- my $rs = Koha::Virtualshelves->search( >- { shelfnumber => [ $public_list->id, $private_list_shared->id ] } ); >+ my $rs = Koha::Virtualshelves->search( { shelfnumber => [ $public_list->id, $private_list_shared->id ] } ); > > my $result = $rs->disown_or_delete; > $rs->reset; > >- is( $rs->count, 1, 'Only public list should be transferred' ); >+ is( $rs->count, 1, 'Only public list should be transferred' ); > is( $rs->next->id, $public_list->id, 'Check id too' ); > > $schema->storage->txn_rollback; >-- >2.39.5
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 39145
:
178136
|
178137
|
178138
|
182851
|
182870
|
182871
|
182872
| 182873