Skip to content

Commit

Permalink
[4] Catch, translate, and expound when GD not available. (#33055)
Browse files Browse the repository at this point in the history
* Catch, translate, and expound when GD not available.

Signed-off-by: Phil E. Taylor <phil@phil-taylor.com>

* Update administrator/components/com_templates/src/View/Template/HtmlView.php

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
  • Loading branch information
Phil E. Taylor and richard67 authored May 2, 2021
1 parent 42cd2ee commit a1ab74a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/com_templates.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a1ab74a

Please sign in to comment.