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] Catch, translate, and expound when GD not available. #1716

Closed
jgerman-bot opened this issue May 2, 2021 · 1 comment · Fixed by #1831
Closed

[4] Catch, translate, and expound when GD not available. #1716

jgerman-bot opened this issue May 2, 2021 · 1 comment · Fixed by #1831

Comments

@jgerman-bot
Copy link

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

Click to expand the diff!
diff --git a/administrator/components/com_templates/src/View/Template/HtmlView.php b/administrator/components/com_templates/src/View/Template/HtmlView.php
index f0b21dca56f24..e3a0e7bf7b436 100644
--- a/administrator/components/com_templates/src/View/Template/HtmlView.php
+++ b/administrator/components/com_templates/src/View/Template/HtmlView.php
@@ -173,8 +173,16 @@ public function display($tpl = null)
 		}
 		elseif (in_array($ext, $imageTypes))
 		{
-			$this->image = $this->get('Image');
-			$this->type  = 'image';
+			try
+			{
+				$this->image = $this->get('Image');
+				$this->type  = 'image';
+			}
+			catch (\RuntimeException $exception)
+			{
+				$app->enqueueMessage(Text::_('COM_TEMPLATES_GD_EXTENSION_NOT_AVAILALE'));
+				$this->type = 'home';
+			}
 		}
 		elseif (in_array($ext, $fontTypes))
 		{
diff --git a/administrator/language/en-GB/com_templates.ini b/administrator/language/en-GB/com_templates.ini
index 47cff0d49119f..32f2d97138308 100644
--- a/administrator/language/en-GB/com_templates.ini
+++ b/administrator/language/en-GB/com_templates.ini
@@ -125,6 +125,7 @@ COM_TEMPLATES_FOLDER_NAME="Folder Name"
 COM_TEMPLATES_FOLDER_NOT_EXISTS="The folder does not exist."
 COM_TEMPLATES_FTP_DESC="For updating the template source files, Joomla will most likely need your FTP account details. Please enter them in the form fields below."
 COM_TEMPLATES_FTP_TITLE="FTP Login Details"
+COM_TEMPLATES_GD_EXTENSION_NOT_AVAILALE="The GD extension for PHP is not available.<br>In order to manipulate images you need additional extensions installed on your server. See the <a href='https://downloads.joomla.org/technical-requirements'>Official Technical Requirements</a> documentation for more details."
 COM_TEMPLATES_GRID_UNSET_LANGUAGE="Unset %s Default"
 COM_TEMPLATES_HEADING_ASSIGNED="Assigned"
 COM_TEMPLATES_HEADING_DEFAULT="Default"
@max123kl
Copy link
Contributor

max123kl commented Jun 2, 2021

mit PR #1831 erledigt

@max123kl max123kl closed this as completed Jun 2, 2021
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