diff --git a/administrator/components/com_joomlaupdate/views/default/view.html.php b/administrator/components/com_joomlaupdate/views/default/view.html.php
index a498dccad8224..29e8f2fbf849d 100644
--- a/administrator/components/com_joomlaupdate/views/default/view.html.php
+++ b/administrator/components/com_joomlaupdate/views/default/view.html.php
@@ -140,6 +140,8 @@ public function display($tpl = null)
$this->warnings = $warningsModel->getItems();
}
+ $this->selfUpdate = $this->checkForSelfUpdate();
+
// Only Super Users have access to the Update & Install for obvious security reasons
$this->showUploadAndUpdate = JFactory::getUser()->authorise('core.admin');
@@ -149,4 +151,70 @@ public function display($tpl = null)
// Render the view.
parent::display($tpl);
}
+
+ /**
+ * Makes sure that the Joomla! Update Component Update is in the database and check if there is a new version.
+ *
+ * @return boolean True if there is a update else false
+ *
+ * @since 3.6.3
+ */
+ private function checkForSelfUpdate()
+ {
+ $db = JFactory::getDbo();
+
+ $query = $db->getQuery(true)
+ ->select($db->quoteName('extension_id'))
+ ->from($db->quoteName('#__extensions'))
+ ->where($db->quoteName('element') . " = " . $db->quote('com_joomlaupdate'));
+ $db->setQuery($query);
+
+ try
+ {
+ // Get the component extension ID
+ $joomlaUpdateComponentId = $db->loadResult();
+ }
+ catch (RuntimeException $e)
+ {
+ // Something is wrong here!
+ $joomlaUpdateComponentId = 0;
+ JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
+ }
+
+ // Try the update only if we have a extension id
+ if ($joomlaUpdateComponentId != 0)
+ {
+ // Allways force to check for an update!
+ $cache_timeout = 0;
+
+ $updater = JUpdater::getInstance();
+ $updater->findUpdates($joomlaUpdateComponentId, $cache_timeout, JUpdater::STABILITY_STABLE);
+
+ // Fetch the update information from the database.
+ $query = $db->getQuery(true)
+ ->select('*')
+ ->from($db->quoteName('#__updates'))
+ ->where($db->quoteName('extension_id') . ' = ' . $db->quote($joomlaUpdateComponentId));
+ $db->setQuery($query);
+
+ try
+ {
+ $joomlaUpdateComponentObject = $db->loadObject();
+ }
+ catch (RuntimeException $e)
+ {
+ // Something is wrong here!
+ $joomlaUpdateComponentObject = NULL;
+ JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
+ }
+
+ if (is_null($joomlaUpdateComponentObject))
+ {
+ // No Update great!
+ return false;
+ }
+
+ return true;
+ }
+ }
}
diff --git a/administrator/language/en-GB/en-GB.com_joomlaupdate.ini b/administrator/language/en-GB/en-GB.com_joomlaupdate.ini
index cf6dc7c9ac82b..0b15ff808b840 100644
--- a/administrator/language/en-GB/en-GB.com_joomlaupdate.ini
+++ b/administrator/language/en-GB/en-GB.com_joomlaupdate.ini
@@ -29,12 +29,15 @@ COM_JOOMLAUPDATE_VIEW_COMPLETE_MESSAGE="Your site has been successfully updated.
COM_JOOMLAUPDATE_VIEW_DEFAULT_DOWNLOAD_IN_PROGRESS="Downloading update file. Please wait ..."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL="We can't find a download URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_DOWNLOAD_URL_DESC="An update to Joomla %1$s was found, but it wasn't possible to fetch the download URL for that update. There are two possibilities why this happens: - Your host doesn't support the minimum requirements for Joomla %1$s and there is no alternative download for your configuration available. - There is a problem with Joomla Update Server.
Please try to download the update package from the official Joomla download page and use the Upload and Update tab."
+COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE="Live Update is not available"
+COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE_DESC="The Live Update is not available, as there is a new version of the Joomla Update Component that need to be installed first. Click here to install the update"
COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_DIRECTORY="FTP Root"
COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_HOSTNAME="FTP Host"
COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_PASSWORD="FTP Password"
COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_PORT="FTP Port"
COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_USERNAME="FTP Username"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INFOURL="Additional Information"
+COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALL_SELF_UPDATE_FIRST="You must update to the latest version of the Joomla Update Component before you can install the Joomla Core Update!"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLAGAIN="Reinstall Joomla core files"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLED="Installed Joomla version"
COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLUPDATE="Install the Update"