Skip to content

Commit

Permalink
Merge pull request #10 from MagnusSinger/um-change
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyFranci authored Sep 17, 2022
2 parents cd1eb5f + 271c544 commit 4ba32cc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
22 changes: 21 additions & 1 deletion administrator/components/com_installer/src/Model/UpdateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/lib_joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 4ba32cc

Please sign in to comment.