Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.2] install language - an error message when no xml is returned #2510

Closed
jgerman-bot opened this issue Jun 24, 2022 · 0 comments · Fixed by #2512
Closed

[4.2] install language - an error message when no xml is returned #2510

jgerman-bot opened this issue Jun 24, 2022 · 0 comments · Fixed by #2512

Comments

@jgerman-bot
Copy link

New language relevant PR in upstream repo: joomla/joomla-cms#38113 Here are the upstream changes:

Click to expand the diff!
diff --git a/administrator/components/com_installer/src/Model/LanguagesModel.php b/administrator/components/com_installer/src/Model/LanguagesModel.php
index d97dccc0a319..12bdde329517 100644
--- a/administrator/components/com_installer/src/Model/LanguagesModel.php
+++ b/administrator/components/com_installer/src/Model/LanguagesModel.php
@@ -152,6 +152,14 @@ protected function getLanguages()
 		}
 
 		$updateSiteXML = simplexml_load_string($response->body);
+
+		if (!$updateSiteXML)
+		{
+			Factory::getApplication()->enqueueMessage(Text::sprintf('COM_INSTALLER_MSG_ERROR_CANT_RETRIEVE_XML', $updateSite), 'error');
+
+			return;
+		}
+
 		$languages     = array();
 		$search        = strtolower($this->getState('filter.search'));
 
diff --git a/administrator/language/en-GB/com_installer.ini b/administrator/language/en-GB/com_installer.ini
index 90c1d9895ab4..245f636c802d 100644
--- a/administrator/language/en-GB/com_installer.ini
+++ b/administrator/language/en-GB/com_installer.ini
@@ -144,6 +144,7 @@ COM_INSTALLER_MSG_DISCOVER_NOEXTENSION="<strong>No extensions have been discover
 COM_INSTALLER_MSG_DISCOVER_NOEXTENSIONSELECTED="No extension selected."
 COM_INSTALLER_MSG_DISCOVER_PURGEDDISCOVEREDEXTENSIONS="Cleared discovered extensions."
 COM_INSTALLER_MSG_ERROR_CANT_CONNECT_TO_UPDATESERVER="Can't connect to %s"
+COM_INSTALLER_MSG_ERROR_CANT_RETRIEVE_XML="Can't retrieve XML from %s"
 COM_INSTALLER_MSG_INSTALL_ENTER_A_URL="Please enter a URL"
 COM_INSTALLER_MSG_INSTALL_INVALID_URL="Invalid URL"
 COM_INSTALLER_MSG_INSTALL_INVALID_URL_SCHEME="Please enter a valid URL starting with http or https."
heelc29 added a commit to heelc29/joomla that referenced this issue Jun 24, 2022
@heelc29 heelc29 changed the title [4] install language - an error message when no xml is returned [4.2] install language - an error message when no xml is returned Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants