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

Pre-Upgrade Compatibility Check on Plugins That Could Kill Joomla Upgrade #31200

Merged
merged 71 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
fa683c4
Alternative presentation of compatibility checks for Joomla 4 from Jo…
Geraint2 May 27, 2020
ed9d1fa
Alternative presentation of compatibility checks for Joomla 4 from Jo…
Geraint2 May 28, 2020
d1c4498
remove accidental commit of .gitignore
Geraint2 May 28, 2020
f7d84a9
Handle situation where we are running 3.10 with an extension what doe…
Geraint2 Jun 3, 2020
acc67ec
Adding user guidance notes for update check
Geraint2 Jun 9, 2020
1913597
Merge remote-tracking branch 'remotes/upstream/3.10-dev' into compati…
Geraint2 Jun 9, 2020
6ec5735
code style
Geraint2 Jun 9, 2020
bcce3c1
Update administrator/components/com_joomlaupdate/controllers/update.php
GeraintEdwards Jun 19, 2020
8dbde56
Update administrator/components/com_joomlaupdate/controllers/update.php
GeraintEdwards Jun 19, 2020
78d9cdf
Changed styling of compatibility feedback columns so that they are al…
Geraint2 Jun 22, 2020
b978657
Revert accidentally committed file
Geraint2 Jun 22, 2020
3ad4e33
Use tabs for HTML spacing
Geraint2 Jun 23, 2020
6615f87
Missing ->state when checking "if ($currentCompatibilityStatus->state…
Geraint2 Jun 24, 2020
49940f7
Merge branch '3.10-dev' into compatibilitycheck
GeraintEdwards Jul 2, 2020
8bc2f9b
implement php cs changes
zero-24 Jul 5, 2020
7e3260f
Merge pull request #1 from zero-24/310checker
GeraintEdwards Jul 6, 2020
0105612
Changes suggested by zero-24
Geraint2 Jul 6, 2020
7640546
Revert accidentally committed file
Geraint2 Jul 6, 2020
c282bad
More changes suggested by zero-24
Geraint2 Jul 6, 2020
985c972
Changes suggested by zero-24
Geraint2 Jul 6, 2020
5390aba
Changes suggested by zero-24
Geraint2 Jul 6, 2020
a1f56d0
Changes suggested by zero-24
Geraint2 Jul 6, 2020
0081f5a
Changes suggested by zero-24
Geraint2 Jul 6, 2020
871d0b6
Revised version to reflect some of Brian's ideas
Geraint2 Jul 14, 2020
8836f0c
Merge branch '3.10-dev' into compatibilitycheck
GeraintEdwards Jul 14, 2020
4ce5907
Merge branch '3.10-dev' into compatibilitycheck
GeraintEdwards Jul 16, 2020
146c7fd
Revised layout in traffic light colour sequence, using 'More Detail' …
Geraint2 Jul 16, 2020
2a59820
Revised layout in traffic light colour sequence, using 'More Detail' …
Geraint2 Jul 16, 2020
9c16dad
Merge branch 'compatibilitycheck' of https://github.com/GeraintEdward…
Geraint2 Jul 16, 2020
b3e691a
Revised layout in traffic light colour sequence, using 'More Detail' …
Geraint2 Jul 16, 2020
4e52937
Update administrator/language/en-GB/en-GB.com_joomlaupdate.ini
GeraintEdwards Jul 16, 2020
63f12cc
Update media/com_joomlaupdate/js/default.js
GeraintEdwards Jul 16, 2020
44e02fc
Update media/com_joomlaupdate/js/default.js
GeraintEdwards Jul 16, 2020
f90f81f
Language string tweak as per bayareajenn's suggestion
Geraint2 Jul 16, 2020
32eaa1f
Merge branch '3.10-dev' of https://github.com/joomla/joomla-cms into …
Geraint2 Oct 17, 2020
1a119b7
First cut at flagging plugins that need attention
Geraint2 Oct 17, 2020
b440563
Add language string, confirm dialog and messages
Geraint2 Oct 21, 2020
99db19e
should not have committed .gitignore
Geraint2 Oct 21, 2020
60eaca4
phpcs correction
Geraint2 Oct 22, 2020
4d12a0b
Update administrator/components/com_joomlaupdate/models/default.php
GeraintEdwards Oct 27, 2020
d6a542b
Update administrator/components/com_joomlaupdate/models/default.php
GeraintEdwards Oct 27, 2020
4c00b6b
Update administrator/language/en-GB/en-GB.com_joomlaupdate.ini
GeraintEdwards Oct 27, 2020
fcd2f83
Update administrator/language/en-GB/en-GB.com_joomlaupdate.ini
GeraintEdwards Oct 27, 2020
940092f
Update administrator/components/com_joomlaupdate/views/default/tmpl/d…
GeraintEdwards Oct 27, 2020
a1f197e
Update administrator/components/com_joomlaupdate/views/default/tmpl/d…
GeraintEdwards Oct 27, 2020
e8b1112
Update administrator/components/com_joomlaupdate/views/default/tmpl/d…
GeraintEdwards Oct 27, 2020
009778f
Update administrator/components/com_joomlaupdate/views/default/tmpl/d…
GeraintEdwards Oct 27, 2020
fb7d407
zero-24 suggestions
Geraint2 Oct 27, 2020
f96229e
Merge branch 'compatibilitycheck' of https://github.com/GeraintEdward…
Geraint2 Oct 27, 2020
5e833c4
Merge branch '3.10-dev' into compatibilitycheck
GeraintEdwards Oct 28, 2020
84ae724
Update administrator/language/en-GB/en-GB.com_joomlaupdate.ini
GeraintEdwards Nov 2, 2020
b7e1b24
Update administrator/language/en-GB/en-GB.com_joomlaupdate.ini
GeraintEdwards Nov 2, 2020
1de7224
Update administrator/language/en-GB/en-GB.com_joomlaupdate.ini
GeraintEdwards Nov 2, 2020
dbb9c22
Update administrator/language/en-GB/en-GB.com_joomlaupdate.ini
GeraintEdwards Nov 2, 2020
4e5f2bf
Update administrator/language/en-GB/en-GB.com_joomlaupdate.ini
GeraintEdwards Nov 2, 2020
e3b9278
Update administrator/language/en-GB/en-GB.com_joomlaupdate.ini
GeraintEdwards Nov 2, 2020
c67e078
Updates as suggested in Git Discussion to make potentially serious pr…
Geraint2 Nov 4, 2020
4358d4f
Merge remote-tracking branch 'origin/compatibilitycheck' into compati…
Geraint2 Nov 4, 2020
5ec4417
Updates as suggested in Git Discussion
Geraint2 Nov 4, 2020
666a960
Merge branch '3.10-dev' into compatibilitycheck
GeraintEdwards Nov 4, 2020
bf8d43d
Add problem plugin author and author URL information to the warning i…
Geraint2 Nov 5, 2020
0f9108e
phpcs
Geraint2 Nov 5, 2020
1f2d63b
Fix for preupdatechecker not auto-starting automatically
Geraint2 Nov 14, 2020
bc0816d
Merge branch '3.10-dev' into compatibilitycheck
richard67 Dec 19, 2020
9005b02
Merge branch '3.10-dev' into compatibilitycheck
GeraintEdwards Jan 13, 2021
0802d72
Merge branch '3.10-dev' into compatibilitycheck
zero-24 Jan 19, 2021
a9f3dea
Merge branch '3.10-dev' into compatibilitycheck
GeraintEdwards Jan 31, 2021
6c00eec
Change language string COM_JOOMLAUPDATE_VIEW_DEFAULT_SHOW_MORE_COMPA…
Geraint2 Jan 31, 2021
7de127e
When there are no extensions installed or no non-Core Critical Plugin…
Geraint2 Feb 2, 2021
2786566
Merge branch '3.10-dev' into compatibilitycheck
GeraintEdwards Feb 4, 2021
9639b37
Merge branch '3.10-dev' into compatibilitycheck
GeraintEdwards Mar 15, 2021
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
55 changes: 55 additions & 0 deletions administrator/components/com_joomlaupdate/models/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,61 @@ private static function isNonCoreExtension($extension)
return !\JExtensionHelper::checkIfCoreExtension($extension->type, $extension->element, $extension->client_id, $extension->folder);
}

/**
* Gets an array containing all installed and enabled plugins, that are not core plugins.
*
* @param array $folderFilter Limit the list of plugins to a specific set of folder values
*
* @return array name,version,updateserver
*
* @since __DEPLOY_VERSION__
*/
public function getNonCorePlugins($folderFilter = array())
{
$db = $this->getDbo();
$query = $db->getQuery(true);

$query->select(
$db->qn('ex.name') . ', ' .
$db->qn('ex.extension_id') . ', ' .
$db->qn('ex.manifest_cache') . ', ' .
$db->qn('ex.type') . ', ' .
$db->qn('ex.folder') . ', ' .
$db->qn('ex.element') . ', ' .
$db->qn('ex.client_id') . ', ' .
$db->qn('ex.package_id')
)->from(
$db->qn('#__extensions', 'ex')
)->where(
$db->qn('ex.type') . ' = ' . $db->quote('plugin')
)->where(
$db->qn('ex.enabled') . ' = 1'
);

if (count($folderFilter) > 0)
{
$folderFilter = array_map(array($db, 'quote'), $folderFilter);

$query->where($db->qn('folder') . ' IN (' . implode(',', $folderFilter) . ')');
}

$db->setQuery($query);
$rows = $db->loadObjectList();
$rows = array_filter($rows, 'JoomlaupdateModelDefault::isNonCoreExtension');

foreach ($rows as $plugin)
{
$decode = json_decode($plugin->manifest_cache);
$this->translateExtensionName($plugin);
$plugin->version = isset($decode->version)
? $decode->version
: JText::_('COM_JOOMLAUPDATE_PREUPDATE_UNKNOWN_EXTENSION_MANIFESTCACHE_VERSION');
unset($plugin->manifest_cache);
}

return $rows;
}

/**
* Called by controller's fetchExtensionCompatibility, which is called via AJAX.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

JHtml::_('jquery.framework');
JHtml::_('bootstrap.tooltip');
JHtml::_('bootstrap.popover');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('script', 'com_joomlaupdate/default.js', array('version' => 'auto', 'relative' => true));

Expand All @@ -21,6 +22,10 @@
JText::script('COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_NO_COMPATIBILITY_INFORMATION');
JText::script('COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_WARNING_UNKNOWN');
JText::script('COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_SERVER_ERROR');
JText::script('COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN');
JText::script('COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_DESC');
JText::script('COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_LIST');
JText::script('COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_CONFIRM_MESSAGE');

$latestJoomlaVersion = $this->updateInfo['latest'];
$currentJoomlaVersion = isset($this->updateInfo['current']) ? $this->updateInfo['current'] : JVERSION;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,34 @@
JFactory::getDocument()->addScriptDeclaration("var COM_JOOMLAUPDATE_VIEW_DEFAULT_SHOW_MORE_EXTENSION_COMPATIBILITY_INFORMATION = '" . JText::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_SHOW_MORE_EXTENSION_COMPATIBILITY_INFORMATION', '<span class="icon-chevron-right large-icon" style="font-size:0.85rem"></span>', true) . "';");
JFactory::getDocument()->addScriptDeclaration("var COM_JOOMLAUPDATE_VIEW_DEFAULT_SHOW_LESS_EXTENSION_COMPATIBILITY_INFORMATION = '" . JText::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_SHOW_LESS_EXTENSION_COMPATIBILITY_INFORMATION', '<span class="icon-chevron-up large-icon" style="font-size:0.85rem"></span>', true) . "';");

JFactory::getDocument()->addScriptDeclaration("var nonCoreCriticalPlugins = '" . json_encode($this->nonCoreCriticalPlugins) . "';");

$compatibilityTypes = array(
'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_RUNNING_PRE_UPDATE_CHECKS' => array(
'class' => 'label-default',
'notes' => 'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_RUNNING_PRE_UPDATE_CHECKS_NOTES'
'notes' => 'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_RUNNING_PRE_UPDATE_CHECKS_NOTES',
'group' => 0
),
'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_PRE_UPDATE_CHECKS_FAILED' => array(
'class' => 'label-important',
'notes' => 'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_PRE_UPDATE_CHECKS_FAILED_NOTES',
'group' => 4
),
'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_UPDATE_SERVER_OFFERS_NO_COMPATIBLE_VERSION' => array(
'class' => 'label-important',
'notes' => 'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_UPDATE_SERVER_OFFERS_NO_COMPATIBLE_VERSION_NOTES'
'notes' => 'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_UPDATE_SERVER_OFFERS_NO_COMPATIBLE_VERSION_NOTES',
'group' => 1
),
'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_REQUIRING_UPDATES_TO_BE_COMPATIBLE' => array(
'class' => 'label-warning',
'notes' => 'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_REQUIRING_UPDATES_TO_BE_COMPATIBLE_NOTES'
'notes' => 'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_REQUIRING_UPDATES_TO_BE_COMPATIBLE_NOTES',
'group' => 2
),
'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_PROBABLY_COMPATIBLE' => array(
'class' => 'label-success',
'notes' => 'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_PROBABLY_COMPATIBLE_NOTES'
),
'notes' => 'COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_PROBABLY_COMPATIBLE_NOTES',
'group' => 3
)
);

?>
Expand Down Expand Up @@ -122,11 +133,11 @@
<h3>
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS'); ?>
</h3>
<?php $compatibilityTypeCount = 0; ?>
<?php foreach ($compatibilityTypes as $compatibilityType => $compatibilityData) : ?>
<?php $compatibilityDisplayClass = $compatibilityData['class']; ?>
<?php $compatibilityDisplayNotes = $compatibilityData['notes']; ?>
<fieldset id="compatibilitytype<?php echo $compatibilityTypeCount;?>" class="span12 compatibilitytypes">
<?php $compatibilityTypeGroup = $compatibilityData['group']; ?>
<fieldset id="compatibilitytype<?php echo $compatibilityTypeGroup;?>" class="span12 compatibilitytypes">
<legend class="label <?php echo $compatibilityDisplayClass;?>">
<h3>
<?php if ($compatibilityType !== "COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_RUNNING_PRE_UPDATE_CHECKS") : ?>
Expand Down Expand Up @@ -186,7 +197,6 @@ class="extension-check upcomp hidden"
</tbody>
</table>
</fieldset>
<?php $compatibilityTypeCount ++;?>
<?php endforeach; ?>
</div>
<?php else: ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,84 @@
</tr>
</tbody>
<tfoot>
<tr id="preupdateCheckWarning">
<td colspan="2">
<div class="alert ">
<h4 class="alert-heading">
<?php echo JText::_('WARNING'); ?>
</h4>
<div class="alert-message">
<div class="preupdateCheckIncomplete">
<?php echo JText::_('COM_JOOMLAUPDATE_PREUPDATE_CHECK_NOT_COMPLETE'); ?>
</div>
</div>
</div>
</td>
</tr>
<tr id="preupdateCheckCompleteProblems" class="hidden">
<td colspan="2">
<div class="alert ">
<h4 class="alert-heading">
<?php echo JText::_('WARNING'); ?>
</h4>
<div class="alert-message">
<div class="preupdateCheckComplete">
<?php echo JText::_('COM_JOOMLAUPDATE_PREUPDATE_CHECK_COMPLETED_YOU_HAVE_DANGEROUS_PLUGINS'); ?>
</div>
</div>
</div>
</td>
</tr>
<tr id="preupdateconfirmation" >
<td class="preupdateconfirmation_label">
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_PLUGIN_BEING_CHECKED'); ?>
</td>
<td>
<table>
<thead>
<th>
<?php echo JText::_('COM_INSTALLER_TYPE_PLUGIN'); ?>
</th>
<th>
<?php echo JText::_('COM_INSTALLER_TYPE_PACKAGE'); ?>
</th>
</thead>
<?php foreach ($this->nonCoreCriticalPlugins as $nonCoreCriticalPlugin) : ?>
<tr id='plg_<?php echo $nonCoreCriticalPlugin->extension_id ?>'>
<td>
<?php echo JText::_($nonCoreCriticalPlugin->name); ?>
</td>
<?php if ($nonCoreCriticalPlugin->package_id > 0) : ?>
<?php foreach ($this->nonCoreExtensions as $nonCoreExtension) : ?>
<?php if ($nonCoreCriticalPlugin->package_id == $nonCoreExtension->extension_id) : ?>
<td>
<?php echo $nonCoreExtension->name; ?>
</td>
<?php endif; ?>
<?php endforeach; ?>
<?php else : ?>
<td/>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</table>
</td>
</tr>
<tr id="preupdatecheckbox" >
<td>
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_PLUGIN_CONFIRMATION'); ?>
</td>
<td>
<input type="checkbox" id="noncoreplugins" name="noncoreplugins" value="1" required aria-required="true" />
</td>
</tr>

<tr>
<td>
&nbsp;
</td>
<td>
<button class="btn btn-primary" type="submit">
<button class="btn btn-primary disabled submitupdate" type="submit" disabled>
<?php echo JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_INSTALLUPDATE'); ?>
</button>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ public function display($tpl = null)
$this->methodSelectUpload = JoomlaupdateHelperSelect::getMethods($defaultMethod, 'method', 'upload_method');

// Get results of pre update check evaluations
$this->phpOptions = $model->getPhpOptions();
$this->phpSettings = $model->getPhpSettings();
$this->nonCoreExtensions = $model->getNonCoreExtensions();
$this->phpOptions = $model->getPhpOptions();
$this->phpSettings = $model->getPhpSettings();
$this->nonCoreExtensions = $model->getNonCoreExtensions();
$this->nonCoreCriticalPlugins = $model->getNonCorePlugins(array('system','user','authentication','actionlog','twofactorauth'));

// Set the toolbar information.
JToolbarHelper::title(JText::_('COM_JOOMLAUPDATE_OVERVIEW'), 'loop install');
Expand Down
10 changes: 10 additions & 0 deletions administrator/language/en-GB/en-GB.com_joomlaupdate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ COM_JOOMLAUPDATE_TOOLBAR_CHECK="Check for Updates"
COM_JOOMLAUPDATE_PREUPDATE_HEADING_CHECKED="Checked"
COM_JOOMLAUPDATE_PREUPDATE_HEADING_REQUIREMENT="Requirement"
COM_JOOMLAUPDATE_PREUPDATE_UNKNOWN_EXTENSION_MANIFESTCACHE_VERSION="Unknown Version"
COM_JOOMLAUPDATE_PREUPDATE_CHECK_NOT_COMPLETE="Pre-Update checks have not been completed yet - please wait"
GeraintEdwards marked this conversation as resolved.
Show resolved Hide resolved
COM_JOOMLAUPDATE_UPDATE_LOG_CLEANUP="Cleaning up after installation."
COM_JOOMLAUPDATE_UPDATE_LOG_COMPLETE="Update to version %s is complete."
; The following two strings are deprecated and will be removed with 4.0
Expand All @@ -54,6 +55,8 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_FTP_DIRECTORY="FTP Root"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXPLANATION_AND_LINK_TO_DOCS="The pre-update check provides you with information about the readiness of your server, settings and installed extensions for the update.<br>You can find more information about this page and how to prepare for updating Joomla in the <a class='pre-update-docs' href='https://docs.joomla.org/Pre-Update_Check'>pre-update check documentation</a>."
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_RUNNING_PRE_UPDATE_CHECKS="Running Pre-Update Checks"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_RUNNING_PRE_UPDATE_CHECKS_NOTES="Please be patient whilst we run the pre-update checks on your extensions."
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_PRE_UPDATE_CHECKS_FAILED="Pre-Update Checks Failed"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_PRE_UPDATE_CHECKS_FAILED_NOTES="It was not possible to check the compatibility of these plugins. The request to the update server either timed out or returned an error"
GeraintEdwards marked this conversation as resolved.
Show resolved Hide resolved
GeraintEdwards marked this conversation as resolved.
Show resolved Hide resolved
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_PROBABLY_COMPATIBLE="No Update Required"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_PROBABLY_COMPATIBLE_NOTES="<p>The extension developer states that the currently installed version is compatible.</p><p id='updateyellowwarning' class='hidden'>Please note that if you see a version highlighted as <span class='label label-warning'>X.X.X</span> then the extension developer is offering a newer version of the extension for your current version of Joomla than they do for the new version of Joomla. You should check with the extension developer if this is correct before you ugprade Joomla.</p>"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_REQUIRING_UPDATES_TO_BE_COMPATIBLE="Update Required"
Expand All @@ -73,6 +76,12 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_WARNING_UNKNOWN="Unkown error"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_SERVER_ERROR="Update Server error"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS="Extensions Pre-Update Check"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_NONE="No extensions installed."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_PLUGIN_BEING_CHECKED="The system is currently checking these plugins to see if they could cause problems during the upgrade.<br>Please be patient while the checks are completed."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_PLUGIN_BEING_CHECKED="The system is currently checking these plugins to see if they could cause problems during the upgrade.<br>Please be patient while the checks are completed."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_PLUGIN_BEING_CHECKED="Checking these plugins to see if they could cause problems during the upgrade.<br>Please be patient while the checks are completed."

Not really sure when this is displayed as I couldnt see it BUT need to be change the language or it might be interpreted as saying that joomla is checking the code in the plugins

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you switch to the 'live update' tab as soon as you load the update page then its shown next to the list of plugins.

It only really shows up if the update checks are being slow and is mean to encourage patience! 'The system is currently checking' was meant to convey that the website is doing something right now and the user needs to wait.

COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_PLUGIN_CONFIRMATION="Do you wish to ignore the warnings about potentially incompatible plugins and to proceed with the upgrade"
GeraintEdwards marked this conversation as resolved.
Show resolved Hide resolved
COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN="Potentially Serious Problem"
COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_CONFIRM_MESSAGE="Are you sure you wish to proceed with the upgrade and ignore the warnings about potentially incompatible plugins?"
GeraintEdwards marked this conversation as resolved.
Show resolved Hide resolved
COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_DESC="This extension includes a plugin that could cause your upgrade to fail.<br><br>To perform the Joomla upgrade safely you should either upgrade this extension to a version compatible with your target version of Joomla or disable the relevant plugin(s) and check again.<br><br>For more information about the relevant plugins please check the 'Live Update' tab."
GeraintEdwards marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For more information about the relevant plugins please check the 'Live Update' tab.

Can we not display this on the same page?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I placed the information directly above the "submit" button to make it really obvious to the user. The downside, as you point out, is the information in 2 different places.

COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_LIST="The following plugins could cause problems during the upgrade"
COM_JOOMLAUPDATE_VIEW_DEFAULT_DB_NOT_SUPPORTED="Your database type is not supported"
COM_JOOMLAUPDATE_VIEW_DEFAULT_DB_NOT_SUPPORTED_DESC="An update to Joomla %1$s was found, but your current database type is not supported by the new version.<br>For further details take a look at <a href="_QQ_"https://downloads.joomla.org/technical-requirements"_QQ_">the minimum requirements for Joomla %1$s</a>."
COM_JOOMLAUPDATE_VIEW_DEFAULT_PHP_VERSION_NOT_SUPPORTED="Your PHP version is not supported"
Expand Down Expand Up @@ -100,6 +109,7 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_NO_LIVE_UPDATE_DESC="There is a new version of the
COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE="Update package URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE_REINSTALL="Reinstall package URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_PREUPDATE_CHECK="Pre-Update Check"
COM_JOOMLAUPDATE_PREUPDATE_CHECK_COMPLETED_YOU_HAVE_DANGEROUS_PLUGINS="You have plugins installed and enabled that could interfere with the Joomla upgrade and could result in an upgrade failure that leaves your site inaccessible.<br><br>You are strongly advised to upgrade, disable or uninstall these plugins prior to upgrading your site."
GeraintEdwards marked this conversation as resolved.
Show resolved Hide resolved
COM_JOOMLAUPDATE_VIEW_DEFAULT_RECOMMENDED="Recommended"
COM_JOOMLAUPDATE_VIEW_DEFAULT_RECOMMENDED_SETTINGS="Recommended PHP Settings"
COM_JOOMLAUPDATE_VIEW_DEFAULT_RECOMMENDED_SETTINGS_DESC="These settings are recommended for PHP in order to ensure full compatibility with Joomla. However, Joomla! will still operate if your settings do not quite match the recommended configuration."
Expand Down
75 changes: 75 additions & 0 deletions media/com_joomlaupdate/js/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,27 @@ function extractionMethodHandler(target, prefix)
* Called by document ready, setup below.
*/
PreUpdateChecker.run = function () {

$('#preupdatecheckbox #noncoreplugins').on('change', function ()
{
if ($('#preupdatecheckbox #noncoreplugins').is(':checked')) {
if (confirm(Joomla.JText._('COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_CONFIRM_MESSAGE'))) {
$('button.submitupdate').removeClass('disabled');
$('button.submitupdate').prop('disabled', false);
}
else
{
$('#preupdatecheckbox #noncoreplugins').prop('checked', false);
}
} else {
$('button.submitupdate').addClass('disabled');
$('button.submitupdate').prop('disabled', true);
}

});

PreUpdateChecker.nonCoreCriticalPlugins = Object.values(JSON.parse(nonCoreCriticalPlugins));

// Get version of the available joomla update
PreUpdateChecker.joomlaTargetVersion = window.joomlaTargetVersion;
PreUpdateChecker.joomlaCurrentVersion = window.joomlaCurrentVersion;
Expand Down Expand Up @@ -155,6 +176,10 @@ function extractionMethodHandler(target, prefix)
if (extensionData.serverError) {
// An error occurred -> show unknown error note
html = Joomla.JText._('COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_SERVER_ERROR');
// force result into group 4 = Pre update checks failed
extensionData.compatibilityData = {
'resultGroup' : 4
}
}
else {
// Switch the compatibility state
Expand Down Expand Up @@ -221,9 +246,59 @@ function extractionMethodHandler(target, prefix)

document.getElementById('compatibilitytype0').style.display = 'block';

// Process the nonCoreCriticalPlugin list
if (extensionData.compatibilityData.resultGroup === 3)
{
for (var cpi in PreUpdateChecker.nonCoreCriticalPlugins)
{
if(PreUpdateChecker.nonCoreCriticalPlugins[cpi].package_id == extensionId || PreUpdateChecker.nonCoreCriticalPlugins[cpi].extension_id == extensionId)
{
$('#plg_' + PreUpdateChecker.nonCoreCriticalPlugins[cpi].extension_id).remove();
PreUpdateChecker.nonCoreCriticalPlugins.splice(cpi,1);
}
}
}

// Have we finished?
if ($('#compatibilitytype0 tbody td').length == 0) {
$('#compatibilitytype0').css('display', 'none');
for (var cpi in PreUpdateChecker.nonCoreCriticalPlugins)
{
var problemPluginRow = $('td[data-extension-id=' + PreUpdateChecker.nonCoreCriticalPlugins[cpi].extension_id +']');
if (!problemPluginRow.length)
{
problemPluginRow = $('td[data-extension-id=' + PreUpdateChecker.nonCoreCriticalPlugins[cpi].package_id +']');
}
if (problemPluginRow.length)
{
var tableRow = problemPluginRow.closest('tr');
tableRow.addClass('error');
var pluginTitleTableCell = tableRow.find('td:first-child');
pluginTitleTableCell.html(pluginTitleTableCell.html()
+ '<span class="label label-warning hasPopover" '
+ ' title="' + Joomla.JText._('COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN') +'"'
+ ' data-content="' + Joomla.JText._('COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_DESC') +'"'
+ '>'
+ '<span class="icon-warning"></span>'
+ Joomla.JText._('COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN')
+ '</span>');
var popoverElement = pluginTitleTableCell.find('.hasPopover');

popoverElement.popover({"placement": "top","trigger": "hover focus click"});
}
}
if (PreUpdateChecker.nonCoreCriticalPlugins.length == 0)
{
$('#preupdateCheckWarning, #preupdateconfirmation, #preupdatecheckbox').css('display', 'none');
$('#preupdatecheckbox #noncoreplugins').prop('checked', true);
$('button.submitupdate').removeClass('disabled');
$('button.submitupdate').prop('disabled', false);
}
else {
$('#preupdateCheckWarning').addClass('hidden');
$('#preupdateCheckCompleteProblems').removeClass('hidden');
$('#preupdateconfirmation .preupdateconfirmation_label').html(Joomla.JText._('COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_LIST'))
}
}
}

Expand Down
Loading