From 14a6b6966160919cda5ae510df747b025e4db2bb Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Tue, 19 Dec 2023 15:29:35 +0000 Subject: [PATCH] Bug 35536: Remove last two references to resultset PluginData Test plan: Run t/db_dependent/Koha/Plugins/Plugins.t Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer (cherry picked from commit 34cc0d29dfd6fe9fb8201640a13936cd5fa6b1b4) Signed-off-by: Fridolin Somers --- Koha/Plugins.pm | 5 ++--- t/db_dependent/Koha/Plugins/Plugins.t | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm index cd08953515..d93e9fe40f 100644 --- a/Koha/Plugins.pm +++ b/Koha/Plugins.pm @@ -121,9 +121,8 @@ sub get_enabled_plugins { my @plugin_classes; try { - my $rs = Koha::Database->schema->resultset('PluginData'); - $rs = $rs->search({ plugin_key => '__ENABLED__', plugin_value => 1 }); - @plugin_classes = $rs->get_column('plugin_class')->all(); + my $rs = Koha::Plugins::Datas->search({ plugin_key => '__ENABLED__', plugin_value => 1 }); + @plugin_classes = $rs->get_column('plugin_class'); } catch { warn "$_"; }; diff --git a/t/db_dependent/Koha/Plugins/Plugins.t b/t/db_dependent/Koha/Plugins/Plugins.t index 53ef4f9a31..1dcd8578b1 100755 --- a/t/db_dependent/Koha/Plugins/Plugins.t +++ b/t/db_dependent/Koha/Plugins/Plugins.t @@ -194,9 +194,7 @@ subtest 'Version upgrade tests' => sub { my $plugin = Koha::Plugin::Test->new( { enable_plugins => 1, cgi => CGI->new } ); # make sure there's no version on the DB - $schema->resultset('PluginData') - ->search( { plugin_class => $plugin->{class}, plugin_key => '__INSTALLED_VERSION__' } ) - ->delete; + Koha::Plugins::Datas->search( { plugin_class => $plugin->{class}, plugin_key => '__INSTALLED_VERSION__' } )->delete; $plugin = Koha::Plugin::Test->new( { enable_plugins => 1, cgi => CGI->new } ); my $version = $plugin->retrieve_data('__INSTALLED_VERSION__'); -- 2.39.5