-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[5.4] Add pre-update checks for backward compatibility plugins for update to Joomla 6 #45493
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
base: 5.4-dev
Are you sure you want to change the base?
[5.4] Add pre-update checks for backward compatibility plugins for update to Joomla 6 #45493
Conversation
Why should I have to enable the j6 compatible plugin. My sites only contain core, no extensions. I don't need to enable the plugin. |
@brianteeman Because we can not know if this is the case when someone updates to J6. Therefore it was decided by the CMS Maintenance Team that it shall be enabled on updates to 6, and the compat6 plugin is enabled by default in Joomla 5, see #45371 . You can later after the update disable in in J6. |
P.S.: Even if there are no 3rd party extensions at all, there still can be overrides using classes which were moved into the compat6 plugin in J6, e.g. from the CMS Filesystem stuff, and we can not really check all that. |
Crazy |
@brianteeman If you think making the update as safe as possible for as many users as possible is crazy then I cannot help you. |
we are doing something very wrong if a site with only core requires this plugin |
It seems you did not understand my previous comment. It is not needed for the core but for the case someone has 3rd party extensions or overrides which require it. |
thank you that pr looks good to me, will test later |
I have tested this item ✅ successfully on 89b2893 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45493. |
I have tested this item 🔴 unsuccessfully on 89b2893 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45493. |
@@ -96,6 +96,10 @@ COM_JOOMLAUPDATE_VIEW_COMPLETE_MESSAGE="Your site has been updated. Your Joomla | |||
COM_JOOMLAUPDATE_VIEW_COMPLETE_UPDATE_ERRORS="Brief list of captured errors" | |||
COM_JOOMLAUPDATE_VIEW_COMPLETE_WITH_ERROR_MESSAGE="The update completed with errors. Please examine the update logs %s for more details.<br>It is recommended to restore the site from backup, fix the issues that caused the update failure and try to update again.<br>You always can ask for help on Joomla! forum %s" | |||
COM_JOOMLAUPDATE_VIEW_DEFAULT_ACTUAL="Actual" | |||
COM_JOOMLAUPDATE_VIEW_DEFAULT_COMPAT_PLUGIN_DISABLED_NOTICE="Go to <a href=\"index.php?option=com_plugins\">'System - Manage - Plugins'</a> and disable the 'Behaviour - Backward Compatibility' plugin." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an alternative, you can use a direct link to the installed filter for this plugin:
index.php?option=com_plugins&view=plugins&filter[folder]=behaviour&filter[element]=compat
@brianteeman Thanks for testing. It seems that there is only the check for database schema in the CLI, all other checks (including those added by this PR) are not there. I wasn't aware of that. Before I update this PR to work also with the CLI, I will investigate if there are other ways to handle the compatibility plugins. We might also need to discuss it again in the maintainers team. I'm setting this PR to draft in the mean time. |
It is a two year old bug |
Pull Request for Issue # .
Summary of Changes
This pull request (PR) adds 2 new checks to the "Required Settings" checks of the pre-update checker which are shown when an update to the next major version (here 6) is found:
If one of these checks fails, you cannot update to the next major version with Live Update.
You can bypass these tests by using the "Upload & Update" button, but that's already the case with other required settings checks and should be fixed with another PR, if ever.
The first check has been agreed by the CMS Maintenance Team.
The plugin has to be disabled before the update so the user can see if the site crashes due to a 3rd party extension like e.g. a system plugin which requires the plugin so it very likely will not work anymore on Joomla 6.
If that happens, the user can enable it again in the database and the site is operable again, e.g. fopr updating or uninstalling that extension.
If we would not do that, the site would break during the update when files are already unpacked but the database has not been updated yet, and that would be fixed not that easy.
The second check is for the case that the admin has disabled the J6 b/c plugin, what one should not do, but we can't really prevent it.
Documentation required?
I don't know if it needs to create or update some documentation for the change made by this PR.
Testing Instructions
On a current 5.4-dev branch or latest 5.4 nightly build, enable the "Behaviour - Backward Compatibility" plugin.
In the options of the Joomla Update Component, set the update channel to "Custom URL" and enter the custom update URL of the 6.0 nightly builds: https://update.joomla.org/core/nightlies/next_major_list.xml
Check for updates.
Result: See section "Actual result BEFORE applying this Pull Request" below.
Apply the changes from this PR.
Check again for updates.
Result: There are 2 new checks in the "Required Settings" section of the pre-update check.
The first check for the J5 plugin has failed, and a notice is shown with a link to the plugin manager, telling to disable the plugin, and you can not update to Joomla 6 with Live Update.
See first image in section "Expected result AFTER applying this Pull Request" below.
Disable the "Behaviour - Backward Compatibility" plugin.
Check again for updates.
Result: Both new checks have succeeded, and you could update to Joomla 6.
See second image in section "Expected result AFTER applying this Pull Request" below.
Disable the "Behaviour - Backward Compatibility 6" plugin.
Check again for updates.
Result: The second check for the J6 plugin has failed, and a notice is shown with a link to the plugin manager, telling to enable the plugin, and you can not update to Joomla 6 with Live Update.
See third image in section "Expected result AFTER applying this Pull Request" below.
Edit file "libraries/src/Version.php" and change line 50 from
public const MINOR_VERSION = 4;
topublic const MINOR_VERSION = 3;
so we can later find an update to a 5.4 nightly build.Go to "System - Maintenance - Database" (
administrator/index.php?option=com_installer&view=database
), select the "Joomla CMS" record and then use the "Update Structure" button. This will apply the change from step 10 also in the database, so now you are faking to be on version 5.3.0-alpha1.In the options of the Joomla Update Component, set the custom update URL to the one of the 5.4 nightly builds: https://update.joomla.org/core/nightlies/next_minor_list.xml
Check again for updates.
Result: An update to 5.4.0-alpha1 is found. The 2 new checks and the check "Database Supported" are not shown as it is not an update to a new major version, and the update would be possible.
See fourth image in section "Expected result AFTER applying this Pull Request" below.
Actual result BEFORE applying this Pull Request
There is no check about backward compatibility plugins in the "Required Settings" checks of the pre-update checker, and you could update to J6.

Expected result AFTER applying this Pull Request
There are 2 new checks in the "Required Settings" section of the pre-update check:
If the Joomla 5 Backward Compatibility plugin is enabled, a notice is shown with a link to the plugin manager, telling to disable the plugin, and you can not update to Joomla 6 with Live Update.

If the Joomla 5 Backward Compatibility plugin is disabled and the Joomla 6 Backward Compatibility plugin is enabled, both checks are successful, and you could update to Joomla 6.

If the Joomla 6 Backward Compatibility plugin is disabled, a notice is shown with a link to the plugin manager, telling to enable the plugin, and you can not update to Joomla 6 with Live Update.

On update to a new minor or patch version of the same major version, the 2 new checks are not shown, and you could update.

Link to documentations
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed