diff --git a/administrator/components/com_installer/src/Model/UpdateModel.php b/administrator/components/com_installer/src/Model/UpdateModel.php index 78d0560fefb..405b1255bbc 100644 --- a/administrator/components/com_installer/src/Model/UpdateModel.php +++ b/administrator/components/com_installer/src/Model/UpdateModel.php @@ -23,6 +23,7 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Updater\Update; use Joomla\CMS\Updater\Updater; +use Joomla\Database\DatabaseDriver; use Joomla\Database\DatabaseQuery; use Joomla\Database\Exception\ExecutionFailureException; use Joomla\Database\ParameterType; @@ -361,7 +362,26 @@ public function update($uids, $minimumStability = Updater::STABILITY_STABLE) continue; } - $update->loadFromXml($instance->detailsurl, $minimumStability); + $app = Factory::getApplication(); + $db = Factory::getContainer()->get(DatabaseDriver::class); + $query = $db->getQuery(true) + ->select('type') + ->from('#__update_sites') + ->where($db->quoteName('id') . ' = :id') + ->bind(':id', $instance->update_site_id, ParameterType::INTEGER); + $db->setQuery($query); + $updateSiteType = (string) $db->loadObject(); + + if ($updateSiteType == 'tuf') + { + $app->enqueueMessage(Text::_('JLIB_INSTALLER_TUF_NOT_AVAILABLE'), 'error'); + + return; + } + else + { + $update->loadFromXml($instance->detailsurl, $minimumStability); + } // Find and use extra_query from update_site if available $updateSiteInstance = new \Joomla\CMS\Table\UpdateSite($this->getDatabase()); diff --git a/administrator/language/en-GB/lib_joomla.ini b/administrator/language/en-GB/lib_joomla.ini index 178145886bc..450de241eae 100644 --- a/administrator/language/en-GB/lib_joomla.ini +++ b/administrator/language/en-GB/lib_joomla.ini @@ -659,6 +659,7 @@ JLIB_INSTALLER_UNINSTALL="Uninstall" JLIB_INSTALLER_UPDATE="Update" JLIB_INSTALLER_UPDATE_LOG_QUERY="Ran query from file %1$s. Query text: %2$s." JLIB_INSTALLER_WARNING_UNABLE_TO_INSTALL_CONTENT_LANGUAGE="Unable to create a content language for %s language: %s" +JLIB_INSTALLER_TUF_NOT_AVAILABLE="TUF is not available for extensions yet." JLIB_JS_AJAX_ERROR_CONNECTION_ABORT="A connection abort has occurred while fetching the JSON data." JLIB_JS_AJAX_ERROR_NO_CONTENT="No content was returned."