From 66ee8c8bab85f78e7d9e0605121ad77d121e5817 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 --- 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 06bc299c62..ef240f6751 100644 --- a/Koha/Schema/Result/Virtualshelve.pm +++ b/Koha/Schema/Result/Virtualshelve.pm @@ -217,5 +217,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.30.2