From 445e458cf3fb7f03aa56f61d33c5197365f14c62 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 28 Mar 2022 22:07:07 +0000 Subject: [PATCH] Bug 26346: (follow-up) Fixing for QA tool Adding is_boolean to virtualshelves.public and virtualshelves.allow_change_from_staff in Virtualshelve.pm DBIC schema file. Fixing typo in Virtualshelves.t Sponsored-by: Catalyst IT, New Zealand Signed-off-by: Lucas Gass Signed-off-by: Nick Clemens Signed-off-by: Fridolin Somers --- Koha/Schema/Result/Virtualshelve.pm | 8 ++++++++ t/db_dependent/Virtualshelves.t | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Koha/Schema/Result/Virtualshelve.pm b/Koha/Schema/Result/Virtualshelve.pm index 1ddcf74441..8ca7998e3c 100644 --- a/Koha/Schema/Result/Virtualshelve.pm +++ b/Koha/Schema/Result/Virtualshelve.pm @@ -219,5 +219,13 @@ sub koha_objects_class { 'Koha::Virtualshelves'; } +__PACKAGE__->add_columns( + '+public' => { is_boolean => 1 }, +); + +__PACKAGE__->add_columns( + '+allow_change_from_staff' => { is_boolean => 1 }, +); + # You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/t/db_dependent/Virtualshelves.t b/t/db_dependent/Virtualshelves.t index 7d33bfc0de..c23db964ed 100755 --- a/t/db_dependent/Virtualshelves.t +++ b/t/db_dependent/Virtualshelves.t @@ -327,7 +327,7 @@ subtest 'Shelf permissions' => sub { is( $public_shelf->can_be_deleted( $patron3->{borrowernumber} ), 0, 'Public list should not be deleted by someone with no special permissions' ); is( $public_shelf->can_be_deleted( $patron4->{borrowernumber} ), 0, 'Public list should not be deleted by someone with the edit_public_lists sub-permission checked' ); - is( $public_shelf->can_be_managed( $patron1->{borrowernumber} ), 1, 'The owner should be able to manage thier list' ); + is( $public_shelf->can_be_managed( $patron1->{borrowernumber} ), 1, 'The owner should be able to manage their list' ); is( $public_shelf->can_be_managed( $patron2->{borrowernumber} ), 0, 'Public list should not be managed by another staff member' ); is( $public_shelf->can_be_managed( $patron3->{borrowernumber} ), 0, 'Public list should not be managed by someone with no special permissions' ); is( $public_shelf->can_be_managed( $patron4->{borrowernumber} ), 1, 'Public list should be managed by someone with the edit_public_lists sub-permission checked' ); -- 2.39.5