Skip to content

Commit e17e58d

Browse files
cyrezbrianteeman
andauthored
[5.4] Improve Pre-Update Check for Joomla ‎6.0.0: fix confusing message + additional notices (joomla#46324)
* Improve UX: confusing message about the compatibility plugin * Update icons and classes for preupdatecheck.php * Update error messages and notices in language file * Enhance language strings in com_joomlaupdate.ini * Updated various text strings in the Joomla update component language file to include additional information and improve clarity. --------- Co-authored-by: Brian Teeman <[email protected]>
1 parent aeb9687 commit e17e58d

File tree

3 files changed

+62
-23
lines changed

3 files changed

+62
-23
lines changed

administrator/components/com_joomlaupdate/src/Model/UpdateModel.php

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,23 +1360,29 @@ public function getPhpOptions()
13601360
* version is not shown. So this check is actually unnecessary.
13611361
*/
13621362
$option = new \stdClass();
1363-
$option->label = Text::sprintf('INSTL_PHP_VERSION_NEWER', $this->getTargetMinimumPHPVersion());
13641363
$option->state = $this->isPhpVersionSupported();
1365-
$option->notice = null;
1364+
$option->label = $option->state
1365+
? Text::sprintf('INSTL_PHP_VERSION_NEWER', $this->getTargetMinimumPHPVersion())
1366+
: Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_VERSION_NEWER_NOT_SUPPORTED', $this->getTargetMinimumPHPVersion());
1367+
$option->notice = $option->state ? null : Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_VERSION_NEWER_NOT_SUPPORTED_NOTICE');
13661368
$options[] = $option;
13671369

13681370
// Check for zlib support.
13691371
$option = new \stdClass();
1370-
$option->label = Text::_('INSTL_ZLIB_COMPRESSION_SUPPORT');
13711372
$option->state = \extension_loaded('zlib');
1372-
$option->notice = null;
1373+
$option->label = $option->state
1374+
? Text::_('INSTL_ZLIB_COMPRESSION_SUPPORT')
1375+
: Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_MODULE_NOT_LOADED', Text::_('INSTL_ZLIB_COMPRESSION_SUPPORT'));
1376+
$option->notice = $option->state ? null : Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_MODULE_NOT_LOADED_NOTICE');
13731377
$options[] = $option;
13741378

13751379
// Check for XML support.
13761380
$option = new \stdClass();
1377-
$option->label = Text::_('INSTL_XML_SUPPORT');
13781381
$option->state = \extension_loaded('xml');
1379-
$option->notice = null;
1382+
$option->label = $option->state
1383+
? Text::_('INSTL_XML_SUPPORT')
1384+
: Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_MODULE_NOT_LOADED', Text::_('INSTL_XML_SUPPORT'));
1385+
$option->notice = $option->state ? null : Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_MODULE_NOT_LOADED_NOTICE');
13801386
$options[] = $option;
13811387

13821388
// Check for mbstring options.
@@ -1391,26 +1397,33 @@ public function getPhpOptions()
13911397

13921398
// Check for a missing native parse_ini_file implementation.
13931399
$option = new \stdClass();
1394-
$option->label = Text::_('INSTL_PARSE_INI_FILE_AVAILABLE');
13951400
$option->state = $this->getIniParserAvailability();
1396-
$option->notice = null;
1401+
$option->label = $option->state
1402+
? Text::_('INSTL_PARSE_INI_FILE_AVAILABLE')
1403+
: Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PARSE_INI_FILE_NOT_AVAILABLE', Text::_('INSTL_PARSE_INI_FILE_AVAILABLE'));
1404+
$option->notice = $option->state ? null : Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_PARSE_INI_FILE_NOT_AVAILABLE_NOTICE');
13971405
$options[] = $option;
13981406

13991407
// Check for missing native json_encode / json_decode support.
1400-
$option = new \stdClass();
1401-
$option->label = Text::_('INSTL_JSON_SUPPORT_AVAILABLE');
1402-
$option->state = \function_exists('json_encode') && \function_exists('json_decode');
1403-
$option->notice = null;
1404-
$options[] = $option;
1408+
$option = new \stdClass();
1409+
$option->state = \function_exists('json_encode') && \function_exists('json_decode');
1410+
$option->label = $option->state
1411+
? Text::_('INSTL_JSON_SUPPORT_AVAILABLE')
1412+
: Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_MODULE_NOT_LOADED', Text::_('INSTL_JSON_SUPPORT_AVAILABLE'));
1413+
$option->notice = $option->state ? null : Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_MODULE_NOT_LOADED_NOTICE');
1414+
$options[] = $option;
1415+
14051416
$updateInformation = $this->getUpdateInformation();
14061417

14071418
// Extra checks when updating to the next major version of Joomla
14081419
if (version_compare($updateInformation['latest'], (string) Version::MAJOR_VERSION + 1, '>=')) {
14091420
// Check if configured database is compatible with the next major version of Joomla
14101421
$option = new \stdClass();
1411-
$option->label = Text::sprintf('INSTL_DATABASE_SUPPORTED', $this->getConfiguredDatabaseType());
14121422
$option->state = $this->isDatabaseTypeSupported();
1413-
$option->notice = null;
1423+
$option->label = $option->state
1424+
? Text::sprintf('INSTL_DATABASE_SUPPORTED', $this->getConfiguredDatabaseType())
1425+
: Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_NOT_SUPPORTED', $this->getConfiguredDatabaseType());
1426+
$option->notice = $option->state ? null : Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_NOT_SUPPORTED_NOTICE');
14141427
$options[] = $option;
14151428

14161429
// Check if the Joomla 5 backwards compatibility plugin is disabled
@@ -1419,9 +1432,13 @@ public function getPhpOptions()
14191432
$this->translateExtensionName($plugin);
14201433

14211434
$option = new \stdClass();
1422-
$option->label = Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_DISABLED_TITLE', $plugin->name);
14231435
$option->state = !PluginHelper::isEnabled('behaviour', 'compat');
1424-
$option->notice = $option->state ? null : Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_DISABLED_NOTICE', $plugin->folder, $plugin->element);
1436+
$option->label = $option->state
1437+
? $plugin->name
1438+
: Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_BC_DISABLED_TITLE', $plugin->name);
1439+
$option->notice = $option->state
1440+
? null
1441+
: Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_BC_DISABLED_NOTICE', $plugin->name, $plugin->folder, $plugin->element);
14251442
$options[] = $option;
14261443

14271444
// Check if the Joomla 6 backwards compatibility plugin is enabled
@@ -1430,16 +1447,20 @@ public function getPhpOptions()
14301447
$this->translateExtensionName($plugin);
14311448

14321449
$option = new \stdClass();
1433-
$option->label = Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_ENABLED_TITLE', $plugin->name);
14341450
$option->state = PluginHelper::isEnabled('behaviour', 'compat6');
1451+
$option->label = $option->state
1452+
? $plugin->name
1453+
: Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_BC_ENABLED_TITLE', $plugin->name);
14351454
$option->notice = $option->state ? null : Text::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_ENABLED_NOTICE', $plugin->folder, $plugin->element);
14361455
$options[] = $option;
14371456
}
14381457

14391458
// Check if database structure is up to date
14401459
$option = new \stdClass();
1441-
$option->label = Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_STRUCTURE_TITLE');
14421460
$option->state = $this->getDatabaseSchemaCheck();
1461+
$option->label = $option->state
1462+
? Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_STRUCTURE_TITLE')
1463+
: Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_STRUCTURE_NOT_UP_TO_DATE');
14431464
$option->notice = $option->state ? null : Text::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_STRUCTURE_NOTICE');
14441465
$options[] = $option;
14451466

administrator/components/com_joomlaupdate/tmpl/joomlaupdate/preupdatecheck.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
</thead>
163163
<tbody>
164164
<?php foreach ($this->phpOptions as $option) : ?>
165-
<tr>
165+
<tr<?php echo ($option->state ? '' : ' class="border-3 border-danger"'); ?>>
166166
<th scope="row">
167167
<?php echo $option->label; ?>
168168
<?php if ($option->notice) : ?>
@@ -172,9 +172,11 @@
172172
<?php endif; ?>
173173
</th>
174174
<td>
175-
<span class="badge bg-<?php echo $option->state ? 'success' : 'danger'; ?>">
176-
<?php echo Text::_($option->state ? 'JYES' : 'JNO'); ?>
177-
</span>
175+
<?php if ($option->state) : ?>
176+
<span class="badge text-bg-success"><span class="icon-checkmark" aria-hidden="true"></span><?php echo Text::_('JOK'); ?></span>
177+
<?php else : ?>
178+
<span class="badge text-bg-danger"><span class="icon-cancel" aria-hidden="true"></span><?php echo Text::_('COM_JOOMLAUPDATE_ACTION_REQUIRED'); ?></span>
179+
<?php endif; ?>
178180
</td>
179181
</tr>
180182
<?php endforeach; ?>

administrator/language/en-GB/com_joomlaupdate.ini

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
; License GNU General Public License version 2 or later; see LICENSE.txt
44
; Note : All ini files need to be saved as UTF-8
55

6+
COM_JOOMLAUPDATE_ACTION_REQUIRED="Action Required"
67
COM_JOOMLAUPDATE_AUTOUPDATE_REGISTER_ERROR="Error while registering to automated update service: %s (%d)."
78
COM_JOOMLAUPDATE_AUTOUPDATE_REGISTER_SUCCESS="Registered to automated update service."
89
COM_JOOMLAUPDATE_AUTOUPDATE_REGISTER_UNAVAILABLE="The automated update service is unavailable for your site as it's not accessible from the internet. Automated updates have been disabled."
@@ -125,6 +126,9 @@ COM_JOOMLAUPDATE_VIEW_COMPLETE_WITH_ERROR_MESSAGE="The update completed with err
125126
COM_JOOMLAUPDATE_VIEW_DEFAULT_ACTUAL="Actual"
126127
COM_JOOMLAUPDATE_VIEW_DEFAULT_COMPATIBILITY_CHECK="Joomla! %s Compatibility Check"
127128
COM_JOOMLAUPDATE_VIEW_DEFAULT_COMPATIBLE_UPDATE_WARNING="Extensions marked with <span class='label label-warning'>X.X.X</span> have an extension update available for the current version of Joomla which is not marked as compatible with the updated version of Joomla. You should contact the extension developer for more information."
129+
COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_NOT_SUPPORTED="Database not Supported: %s"
130+
COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_NOT_SUPPORTED_NOTICE="Please check the supported databases in the <a class=\"alert-link\" href=\"https://manual.joomla.org/docs/next/get-started/technical-requirements/\" target=\"_blank\" rel=\"noopener noreferrer\">Technical Requirements<span class=\"visually-hidden\"> (Opens the Joomla Programmers Documentation site in a new tab or window)</span></a>."
131+
COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_STRUCTURE_NOT_UP_TO_DATE="Database Table Structure not Up to Date"
128132
COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_STRUCTURE_NOTICE="Go to <a href=\"index.php?option=com_installer&view=database\">'System - Maintenance - Database'</a> and use the 'Update Structure' button."
129133
COM_JOOMLAUPDATE_VIEW_DEFAULT_DATABASE_STRUCTURE_TITLE="Database Table Structure Up to Date"
130134
COM_JOOMLAUPDATE_VIEW_DEFAULT_DB_NOT_SUPPORTED="Your database type is not supported"
@@ -178,11 +182,23 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE_DESC="You must update this componen
178182
COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE="Update package URL"
179183
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."
180184
COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE_REINSTALL="Reinstall package URL"
185+
COM_JOOMLAUPDATE_VIEW_DEFAULT_PARSE_INI_FILE_NOT_AVAILABLE="%s not Available"
186+
COM_JOOMLAUPDATE_VIEW_DEFAULT_PARSE_INI_FILE_NOT_AVAILABLE_NOTICE="Please check the <a class=\"alert-link\" href=\"https://manual.joomla.org/docs/next/get-started/technical-requirements/\" target=\"_blank\" rel=\"noopener noreferrer\">Technical Requirements<span class=\"visually-hidden\"> (Opens the Joomla Programmers Documentation site in a new tab or window)</span></a>."
187+
COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_MODULE_NOT_LOADED="%s not Loaded"
188+
COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_MODULE_NOT_LOADED_NOTICE="Please check the required PHP modules in the <a class=\"alert-link\" href=\"https://manual.joomla.org/docs/next/get-started/technical-requirements/\" target=\"_blank\" rel=\"noopener noreferrer\">Technical Requirements<span class=\"visually-hidden\"> (Opens the Joomla Programmers Documentation site in a new tab or window)</span></a>."
189+
COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_VERSION_NEWER_NOT_SUPPORTED="PHP Version not Supported: %s"
190+
COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_VERSION_NEWER_NOT_SUPPORTED_NOTICE="Please check the supported PHP versions in the <a class=\"alert-link\" href=\"https://manual.joomla.org/docs/next/get-started/technical-requirements/\" target=\"_blank\" rel=\"noopener noreferrer\">Technical Requirements<span class=\"visually-hidden\"> (Opens the Joomla Programmers Documentation site in a new tab or window)</span></a>."
181191
COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_VERSION_NOT_SUPPORTED="Your PHP version is not supported"
182192
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>."
193+
COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_BC_DISABLED_TITLE="The '%s' Plugin Must be Disabled"
194+
COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_BC_DISABLED_NOTICE="This plugin must be disabled and your site working correctly before updating. <br><span class=\"icon-warning\" aria-hidden=\"true\"></span> Before disabling '%1$s' plugin, read the manual: <a class=\"alert-link\" href=\"https://manual.joomla.org/migrations/54-60/compat-plugin/\" target=\"_blank\" rel=\"noopener noreferrer\">Compatibility Plugin<span class=\"visually-hidden\"> (Opens the Joomla Programmers Documentation site in a new tab or window)</span></a> <br>Go to <a href=\"index.php?option=com_plugins&view=plugins&filter[folder]=%2$s&filter[element]=%3$s\">'System - Manage - Plugins'</a> and disable the plugin."
195+
COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_BC_ENABLED_TITLE="The '%s' Plugin Must be Enabled"
196+
; Deprecated, will be removed with 7.0
183197
COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_DISABLED_NOTICE="Go to <a href=\"index.php?option=com_plugins&view=plugins&filter[folder]=%1$s&filter[element]=%2$s\">'System - Manage - Plugins'</a> and disable the plugin."
198+
; Deprecated, will be removed with 7.0
184199
COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_DISABLED_TITLE="The '%s' plugin is disabled"
185200
COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_ENABLED_NOTICE="Go to <a href=\"index.php?option=com_plugins&view=plugins&filter[folder]=%1$s&filter[element]=%2$s\">'System - Manage - Plugins'</a> and enable the plugin."
201+
; Deprecated, will be removed with 7.0
186202
COM_JOOMLAUPDATE_VIEW_DEFAULT_PLUGIN_ENABLED_TITLE="The '%s' plugin is enabled"
187203
COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN="Potential Upgrade Issue."
188204
COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_CONFIRM_MESSAGE="Are you sure you want to acknowledge the warnings about potentially incompatible extensions and proceed with the update?"

0 commit comments

Comments
 (0)