Bug 31401: (QA follow-up) Remove Koha.ArePluginsEnabled, it is no longer needed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c5810c3605)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 0c6eef3816)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
Kyle Hall 2022-09-02 10:27:39 -04:00 committed by Arthur Suzuki
parent 5192d66beb
commit 450872f764
6 changed files with 7 additions and 29 deletions

View File

@ -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;

View File

@ -28,7 +28,7 @@
<li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>
</ul>
[% IF Koha.ArePluginsEnabled() %]
[% IF plugins_enabled %]
<h5>Report plugins</h5>
<ul>
<li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=report">Report plugins</a></li>

View File

@ -94,7 +94,7 @@
[% END %]
</ul>
[% 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 ) %]
<h5>Additional tools</h5>
<ul>
[% IF ( CAN_user_tools_edit_calendar ) %]
@ -116,7 +116,7 @@
[% IF ( CAN_user_tools_edit_quotes ) %]
<li><a href="/cgi-bin/koha/tools/quotes.pl">Quote editor</a></li>
[% END %]
[% IF ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool ) %]
[% IF ( plugins_enabled && CAN_user_plugins_tool ) %]
<li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></li>
[% END %]
[% IF ( CAN_user_tools_upload_general_files ) %]

View File

@ -66,7 +66,7 @@
<li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>
</ul>
[% IF Koha.ArePluginsEnabled() %]
[% IF plugins_enabled %]
<h2>Report plugins</h2>
<ul>
<li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=report">Report plugins</a></li>

View File

@ -95,7 +95,7 @@
<div class="col-sm-4 col-sm-push-4">
[% 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 ) %]
<h3>Additional tools</h3>
[% END %]
<dl>
@ -132,7 +132,7 @@
<dd>Manage 'Quote of the day' quotes</dd>
[% END %]
[% IF ( Koha.ArePluginsEnabled() && CAN_user_plugins_tool && tool_plugins ) %]
[% IF ( plugins_enabled && CAN_user_plugins_tool && tool_plugins ) %]
<dt><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></dt>
<dd>
Use tool plugins

View File

@ -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;