Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions installation/language/en-GB/en-GB.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ INSTL_DATABASE_NO_SCHEMA="No database schema exists for this database type."
INSTL_DATABASE_PASSWORD_DESC="Either a password you created or a password provided by your host."
INSTL_DATABASE_PREFIX_DESC="Enter a table prefix or use the randomly generated one."
INSTL_DATABASE_PREFIX_MSG="The table prefix must start with a letter, optionally be followed by alphanumeric characters and by an underscore"
INSTL_DATABASE_RESPONSE_ERROR="The latest request returned an invalid response:"
INSTL_DATABASE_TYPE_DESC="Select the database type."
INSTL_DATABASE_USER_DESC="Either a username you created or a username provided by your host."
INSTL_DATABASE_VALIDATION_ERROR="Check your database credentials, database type, database name or hostname. If you have MySQL 8 installed then please read this <a href=\"https://docs.joomla.org/Joomla_and_MySQL_8#Workaround_to_get_Joomla_working_with_MySQL_8\" target=\"_blank\">wiki</a> for more information."
Expand Down
1 change: 1 addition & 0 deletions installation/language/en-US/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ INSTL_DATABASE_NO_SCHEMA="No database schema exists for this database type."
INSTL_DATABASE_PASSWORD_DESC="Either a password you created or a password provided by your host."
INSTL_DATABASE_PREFIX_DESC="Enter a table prefix or use the randomly generated one."
INSTL_DATABASE_PREFIX_MSG="The table prefix must start with a letter, optionally be followed by alphanumeric characters and by an underscore"
INSTL_DATABASE_RESPONSE_ERROR="The latest request returned an invalid response:"
INSTL_DATABASE_TYPE_DESC="Select the database type."
INSTL_DATABASE_USER_DESC="Either a username you created or a username provided by your host."
INSTL_DATABASE_VALIDATION_ERROR="Check your database credentials, database type, database name or hostname. If you have MySQL 8 installed then please read this <a href=\"https://docs.joomla.org/Joomla_and_MySQL_8#Workaround_to_get_Joomla_working_with_MySQL_8\" target=\"_blank\">wiki</a> for more information."
Expand Down
2 changes: 2 additions & 0 deletions installation/template/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
Text::script('INSTL_PROCESS_BUSY');
Text::script('INSTL_FTP_SETTINGS_CORRECT');

Text::script('INSTL_DATABASE_RESPONSE_ERROR');

// Load strings for translated messages (directory removal)
Text::script('INSTL_REMOVE_INST_FOLDER');
Text::script('INSTL_COMPLETE_REMOVE_FOLDER');
Expand Down
9 changes: 8 additions & 1 deletion installation/template/js/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,15 @@ Joomla.checkDbCredentials = function() {
perform: true,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
onSuccess: function(response, xhr){
response = JSON.parse(response);
var loaderElement = document.querySelector('joomla-core-loader');
try {
response = JSON.parse(response);
} catch (e) {
loaderElement.parentNode.removeChild(loaderElement);
Joomla.renderMessages({'error': [Joomla.JText._('INSTL_DATABASE_RESPONSE_ERROR'), response]});

return false;
}

if (response.messages) {
Joomla.renderMessages(response.messages);
Expand Down
13 changes: 11 additions & 2 deletions installation/template/js/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,19 @@
data: data,
perform: true,
onSuccess: function(response, xhr){
response = JSON.parse(response);
Joomla.replaceTokens(response.token);
var spinnerElement = document.querySelector('joomla-core-loader');

try {
response = JSON.parse(response);
} catch (e) {
spinnerElement.parentNode.removeChild(spinnerElement);
Joomla.renderMessages({'error': [Joomla.JText._('INSTL_DATABASE_RESPONSE_ERROR'), response]});

return false;
}

Joomla.replaceTokens(response.token);

if (response.error === true)
{
spinnerElement.parentNode.removeChild(spinnerElement);
Expand Down