Skip to content

Commit

Permalink
Improve handling of not supported envoriments
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Sep 21, 2022
1 parent f10f221 commit 60c328f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
13 changes: 13 additions & 0 deletions administrator/components/com_installer/src/Model/WarningsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,19 @@ public function getItems()
];
}

if (Factory::getDbo()->isMinimumVersion() === false) {
$db = Factory::getDbo();
$messages[] = [
'message' => Text::_('COM_INSTALLER_MSG_WARNINGS_NOTSUPPORTEDDATABASEVERSION'),
'description' => Text::sprintf(
'COM_INSTALLER_MSG_WARNINGS_NOTSUPPORTEDDATABASEVERSIONDESC',
$db->getServerType(),
$db->getVersion(),
$db->getMinimum()
),
];
}

return $messages;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@

$displayData = [
'textPrefix' => 'COM_JOOMLAUPDATE' . $this->messagePrefix,
'content' => Text::sprintf($this->langKey, $this->updateSourceKey),
'formURL' => 'index.php?option=com_joomlaupdate&view=joomlaupdate',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/Updating_from_an_existing_version',
'helpURL' => 'https://docs.joomla.org/Special:MyLanguage/J4.x:We_cant_find_a_download_url',
'icon' => 'icon-loop joomlaupdate',
'createURL' => 'index.php?option=com_joomlaupdate&task=update.purge&' . Session::getFormToken() . '=1'
];
Expand All @@ -31,19 +30,6 @@
$displayData['formAppend'] = '<div class="text-center"><a href="' . $uploadLink . '" class="btn btn-sm btn-outline-secondary">' . Text::_($displayData['textPrefix'] . '_EMPTYSTATE_APPEND') . '</a></div>';
}

if (isset($this->updateInfo['object']) && isset($this->updateInfo['object']->get('infourl')->_data)) :
$displayData['content'] .= '<br>' . HTMLHelper::_(
'link',
$this->updateInfo['object']->get('infourl')->_data,
Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_INFOURL'),
[
'target' => '_blank',
'rel' => 'noopener noreferrer',
'title' => isset($this->updateInfo['object']->get('infourl')->title) ? Text::sprintf('JBROWSERTARGET_NEW_TITLE', $this->updateInfo['object']->get('infourl')->title) : ''
]
);
endif;

$content = LayoutHelper::render('joomla.content.emptystate', $displayData);

// Inject Joomla! version
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/com_installer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ COM_INSTALLER_MSG_WARNINGS_UPDATE_NOTICE="Before updating ensure that the update
COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOST="PHP Upload Size bigger than POST size."
COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOSTDESC="The value of the upload_max_filesize in the php.ini file is greater than the post_max_size variable. The post_max_size variable will take precedence and block requests larger than it. This is generally a server misconfiguration when trying to increase upload sizes. Please increase the value of post_max_size to be greater than the value of upload_max_filesize."
COM_INSTALLER_MSG_WARNINGS_UPLOADFILETOOBIG="The selected file cannot be uploaded as it is bigger than the maximum upload size."
COM_INSTALLER_MSG_WARNINGS_NOTSUPPORTEDDATABASEVERSIONDESC="The version of the database system you are using does not meet the <a href=\"https://downloads.joomla.org/technical-requirements\" class=\"alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">core minimum requirements</a>. Right now you are running the following configuration:<br><ul><li>Database type: %1$s </li><li>Database version: %2$s</li><li>Minimum database version: %3$s</li></ul>This means you are running Joomla within a not tested and not-supported environment which can result into issues with the core and extensions. This will also mean that Joomla will not offer any updates via the Joomla Updater to your installation."
COM_INSTALLER_MSG_WARNINGS_NOTSUPPORTEDDATABASEVERSION="The current database version does not meet the minimum requirements"
COM_INSTALLER_N_EXTENSIONS_PUBLISHED="%d extensions enabled."
COM_INSTALLER_N_EXTENSIONS_PUBLISHED_1="Extension enabled."
COM_INSTALLER_N_EXTENSIONS_UNPUBLISHED="%d extensions disabled."
Expand Down
6 changes: 3 additions & 3 deletions administrator/language/en-GB/com_joomlaupdate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ COM_JOOMLAUPDATE_MINIMUM_STABILITY_RC="Release Candidate"
COM_JOOMLAUPDATE_MINIMUM_STABILITY_STABLE="Stable"
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_APPEND="Upload and Update"
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_BUTTON_ADD="Retry check for update"
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_CONTENT="An update to Joomla %1$s was found, but it wasn't possible to fetch the download URL for that update. Either the update to Joomla %1$s is not available for your stability level or there is a problem with the Joomla Update Server.<br>Please try to download the update package from <a href=\"https://downloads.joomla.org/latest\">the official Joomla download page</a> and use the Upload and Update function."
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_CONTENT="An update to Joomla %1$s was found, but it wasn't possible to fetch the download URL for that update. This can have different reasons please check this <a href=\"https://docs.joomla.org/Special:MyLanguage/J4.x:We_cant_find_a_download_url\" class=\"alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">help page</a> for more details."
COM_JOOMLAUPDATE_NODOWNLOAD_EMPTYSTATE_TITLE="We can't find a download URL"
COM_JOOMLAUPDATE_OVERVIEW="Joomla Update"
COM_JOOMLAUPDATE_PREUPDATE_CHECK_CAPTION="Table of server settings to check before update."
Expand Down Expand Up @@ -136,7 +136,7 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_PLUGIN_CONFIRMATION="Acknowledge the warn
COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATES="No updates available"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATESNOTICE="You already have the latest Joomla version, %s."
COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE="Update package URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE_INFO="You can also download <a href=\"%s\" class=\"alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">the update package</a> to your computer and then use the fields below to upload and install it."
COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE_INFO="You can also download <a href=\"%s\" class=\"alert-link\" target=\"_blank\" rel=\"noopener noreferrer\">the update package</a> and install it manually."
COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE_REINSTALL="Reinstall package URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_VERSION_NOT_SUPPORTED="Your PHP version is not supported"
COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_VERSION_NOT_SUPPORTED_DESC="An update to Joomla %1$s was found, but your currently installed PHP version does not match <a href=\"https://downloads.joomla.org/technical-requirements\">the minimum requirements for Joomla %1$s</a>."
Expand All @@ -160,7 +160,7 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_CUSTOM="You are on the &quot;%s&quot;
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_DEFAULT="You are on the &quot;%s&quot; update channel. Through this channel you'll receive notifications for all updates of the current Joomla release (4.x)"
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_NEXT="You are on the &quot;%s&quot; update channel. Through this channel you'll receive notifications for all updates of the current Joomla release (4.x) and you will also be notified when the future major release (5.x) will be available. Before upgrading to 5.x you'll need to assess its compatibility with your environment."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_TESTING="You are on the &quot;%s&quot; update channel. This channel is designed for testing new releases and fixes in Joomla.<br>It is only intended for JBS (Joomla Bug Squad&trade;) members and others within the Joomla community who are testing. Do not use this setting on a production site."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPLOAD_INTRO="You can use this feature to update Joomla if your server is behind a firewall or otherwise unable to contact the update servers. First download the Joomla <em><strong>Update Package</strong></em> in ZIP format from <a class='alert-link' href='%s' target='_blank' rel='noopener noreferrer'>the official Joomla download page</a>. Then use the fields below to upload and install it."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPLOAD_INTRO="You can use this feature to update Joomla if your server is behind a firewall or otherwise unable to contact the update servers. First download the Joomla <em>Update Package</em> in ZIP format from <a class='alert-link' href='%s' target='_blank' rel='noopener noreferrer'>the official Joomla download page</a>. Then use the fields below to upload and install it."
COM_JOOMLAUPDATE_VIEW_UPDATE_BYTESEXTRACTED="Bytes extracted"
COM_JOOMLAUPDATE_VIEW_UPDATE_BYTESREAD="Bytes read"
COM_JOOMLAUPDATE_VIEW_UPDATE_CHECKSUM_WRONG="File Checksum Failed"
Expand Down

0 comments on commit 60c328f

Please sign in to comment.