From 450872f7645071df9bcf0bf3ba6fa84eb35dbfd3 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 2 Sep 2022 10:27:39 -0400 Subject: [PATCH] Bug 31401: (QA follow-up) Remove Koha.ArePluginsEnabled, it is no longer needed Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi (cherry picked from commit c5810c360544de96bf3fb2000c135836b6e2ee10) Signed-off-by: Lucas Gass (cherry picked from commit 0c6eef3816c60f0645c8c3da4ea6e166dfc1b029) Signed-off-by: Arthur Suzuki --- Koha/Template/Plugin/Koha.pm | 10 ---------- .../prog/en/includes/reports-menu.inc | 2 +- .../intranet-tmpl/prog/en/includes/tools-menu.inc | 4 ++-- .../prog/en/modules/reports/reports-home.tt | 2 +- .../prog/en/modules/tools/tools-home.tt | 4 ++-- t/Koha_Template_Plugin_Koha.t | 14 +------------- 6 files changed, 7 insertions(+), 29 deletions(-) diff --git a/Koha/Template/Plugin/Koha.pm b/Koha/Template/Plugin/Koha.pm index 9ecd7fde0d..5e7a303f70 100644 --- a/Koha/Template/Plugin/Koha.pm +++ b/Koha/Template/Plugin/Koha.pm @@ -84,14 +84,4 @@ sub Version { }; } -=head3 ArePluginsEnabled - -Returns true if plugins are enabled, false otherwise. - -=cut - -sub ArePluginsEnabled { - return C4::Context->config('enable_plugins'); -} - 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc index d63b3e923d..3727737311 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc @@ -28,7 +28,7 @@
  • Holds
  • - [% IF Koha.ArePluginsEnabled() %] + [% IF plugins_enabled %]
    Report plugins
    • Report plugins
    • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc index 0d43c5a283..901ca8094f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc @@ -94,7 +94,7 @@ [% END %]
    [% END %] -[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_additional_contents || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool ) || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %] +[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_additional_contents || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( plugins_enabled && CAN_user_plugins_tool ) || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %]
    Additional tools
      [% IF ( CAN_user_tools_edit_calendar ) %] @@ -116,7 +116,7 @@ [% IF ( CAN_user_tools_edit_quotes ) %]
    • Quote editor
    • [% END %] - [% IF ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool ) %] + [% IF ( plugins_enabled && CAN_user_plugins_tool ) %]
    • Tool plugins
    • [% END %] [% IF ( CAN_user_tools_upload_general_files ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt index 98efce96f2..ff69f2abee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tt @@ -66,7 +66,7 @@
    • Holds
    - [% IF Koha.ArePluginsEnabled() %] + [% IF plugins_enabled %]

    Report plugins

    • Report plugins
    • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt index 6bae9178dd..07367a3ef7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt @@ -95,7 +95,7 @@
      -[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_additional_contents || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool ) || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %] +[% IF ( CAN_user_tools_edit_calendar || CAN_user_tools_manage_csv_profiles || CAN_user_tools_view_system_logs || CAN_user_tools_edit_additional_contents || CAN_user_tools_schedule_tasks || CAN_user_tools_edit_quotes || ( plugins_enabled && CAN_user_plugins_tool ) || CAN_user_tools_upload_general_files || CAN_user_tools_access_files ) %]

      Additional tools

      [% END %]
      @@ -132,7 +132,7 @@
      Manage 'Quote of the day' quotes
      [% END %] - [% IF ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool && tool_plugins ) %] + [% IF ( plugins_enabled && CAN_user_plugins_tool && tool_plugins ) %]
      Tool plugins
      Use tool plugins diff --git a/t/Koha_Template_Plugin_Koha.t b/t/Koha_Template_Plugin_Koha.t index 812f5f96cc..a8d66feb9d 100755 --- a/t/Koha_Template_Plugin_Koha.t +++ b/t/Koha_Template_Plugin_Koha.t @@ -17,7 +17,7 @@ use Modern::Perl; -use Test::More tests => 5; +use Test::More tests => 4; use Test::MockModule; use t::lib::Mocks; @@ -77,18 +77,6 @@ subtest "Koha::Template::Plugin::Koha::Version tests" => sub { }; -subtest "Koha::Template::Plugin::Koha::ArePluginsEnabled tests" => sub { - - plan tests => 2; - - t::lib::Mocks::mock_config( 'enable_plugins', 1 ); - is(Koha::Template::Plugin::Koha::ArePluginsEnabled(), 1, "Correct ArePluginsEnabled is yes"); - - t::lib::Mocks::mock_config( 'enable_plugins', 0 ); - is(Koha::Template::Plugin::Koha::ArePluginsEnabled(), 0, "Correct ArePluginsEnabled is no"); - -}; - subtest "Koha::Template::Plugin::Koha::CSVDelimiter tests" => sub { plan tests => 8; -- 2.39.5