From 06ab98665ef6e8a1167d656313d408a4dd7fdcb7 Mon Sep 17 00:00:00 2001 From: Florian DAL FITTO Date: Tue, 24 Oct 2023 23:01:02 +0200 Subject: [PATCH] [K6.3] Remove two parts deprecated --- .../kunena/src/Controller/KunenaControllerBase.php | 2 +- .../kunena/src/Database/KunenaDatabaseObject.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/libraries/kunena/src/Controller/KunenaControllerBase.php b/src/libraries/kunena/src/Controller/KunenaControllerBase.php index 5ff1cef28d8..1bf7e67aac4 100644 --- a/src/libraries/kunena/src/Controller/KunenaControllerBase.php +++ b/src/libraries/kunena/src/Controller/KunenaControllerBase.php @@ -102,7 +102,7 @@ protected function loadApplication(): CMSApplicationInterface */ protected function loadInput(): Input { - return $this->app->input; + return $this->app->getInput(); } /** diff --git a/src/libraries/kunena/src/Database/KunenaDatabaseObject.php b/src/libraries/kunena/src/Database/KunenaDatabaseObject.php index 52392359a5b..ca89b64f093 100644 --- a/src/libraries/kunena/src/Database/KunenaDatabaseObject.php +++ b/src/libraries/kunena/src/Database/KunenaDatabaseObject.php @@ -20,6 +20,7 @@ use Joomla\CMS\Object\CMSObject; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Table\Table; +use Joomla\Database\DatabaseInterface; use Kunena\Forum\Libraries\Exception\KunenaException; /** @@ -166,7 +167,15 @@ public function load($id = null): bool */ protected function getTable() { - $table = Table::getInstance($this->_table, 'Kunena\Forum\Libraries\Tables\Table'); + $className = 'Kunena\Forum\Libraries\Tables\\' . $this->_table; + $db = Factory::getContainer()->get(DatabaseInterface::class); + + if (class_exists($className)) { + $table = new $className($db); + } else { + $className = 'Kunena\Forum\Libraries\Tables\Table' . $this->_table; + $table = new $className($db); + } return $table; }