Opened 3 years ago
Closed 3 years ago
#54405 closed task (blessed) (fixed)
Disable Gutenberg 11.8.2 (and likely earlier) upon upgrade to WordPress 5.9
Reported by: | jorbin | Owned by: | hellofromTonya |
---|---|---|---|
Milestone: | 5.9 | Priority: | normal |
Severity: | blocker | Version: | |
Component: | Upgrade/Install | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Trunk isn't compatible with Gutenberg 11.8.2 since they both declare the interface WP_Theme_JSON_Schema. There is likely a need for a 590 version of _upgrade_580_force_deactivate_incompatible_plugins
Attachments (1)
Change History (19)
#1
@
3 years ago
- Severity changed from normal to blocker
- Type changed from defect (bug) to task (blessed)
This ticket was mentioned in PR #1887 on WordPress/wordpress-develop by hellofromtonya.
3 years ago
#2
- Keywords has-patch added; needs-patch removed
Uses the same strategy from WordPress 5.8 release to deactivate the Gutenberg plugin if its version is incompatible with 5.9. Incompatible version is 11.8.2. Compatible version set to 11.9.
As this is likely needed from release-to-release, refactored the code from 5.8 to a private core function for use in 5.8, 5.9, and future major releases.
Trac ticket: https://core.trac.wordpress.org/ticket/54405
#3
@
3 years ago
- Keywords needs-testing added
Great catch @jorbin! You're right. PR 1887 uses the strategy from 5.8. Marking for needs-testing
.
#4
@
3 years ago
- Keywords commit added
Marking for commit
. Should work without issue. But leaving it marked as needs-testing
to follow-up after commit (i.e. hard to test without it being committed).
#5
@
3 years ago
- Owner set to hellofromTonya
- Status changed from new to reviewing
Preparing commit. Then I'll manually test for both 5.8 and 5.9 to ensure it works as intended. Commit and then test report coming.
hellofromtonya commented on PR #1887:
3 years ago
#7
Committed via changeset https://core.trac.wordpress.org/ticket/54405.
#8
@
3 years ago
- Keywords commit removed
Removing the commit
keyword to get it out of the commit queue. Leaving open for testing and a test report (coming soon).
#9
follow-up:
↓ 11
@
3 years ago
Is it actually necessary to call (and even keep) _upgrade_580_force_deactivate_incompatible_plugins()
in trunk (i.e. WP 5.9+)?
If Gutenberg is so old that it would be deactivated in _upgrade_580_force_deactivate_incompatible_plugins();
, it would also be deactivated by _upgrade_590_force_deactivate_incompatible_plugins();
that is called in the next line.
Thus, we can save a few if comparisons during the core upgrade, which can never hurt.
As long as _upgrade_580_force_deactivate_incompatible_plugins()
stays in the WP 5.8.x branch (which it will, due to the SVN branch), everything should be fine, I believe?
(Moving the plugin deactivation code to a private function would also not really be needed then, either.)
This ticket was mentioned in Slack in #core-auto-updates by afragen. View the logs.
3 years ago
#11
in reply to:
↑ 9
@
3 years ago
Replying to TobiasBg:
Is it actually necessary to call (and even keep)
_upgrade_580_force_deactivate_incompatible_plugins()
in trunk (i.e. WP 5.9+)?
If Gutenberg is so old that it would be deactivated in_upgrade_580_force_deactivate_incompatible_plugins();
, it would also be deactivated by_upgrade_590_force_deactivate_incompatible_plugins();
that is called in the next line.
Thus, we can save a few if comparisons during the core upgrade, which can never hurt.
As long as
_upgrade_580_force_deactivate_incompatible_plugins()
stays in the WP 5.8.x branch (which it will, due to the SVN branch), everything should be fine, I believe?
(Moving the plugin deactivation code to a private function would also not really be needed then, either.)
Hmm, good points @TobiasBg. I agree. _upgrade_580_force_deactivate_incompatible_plugins()
was deactivating Gutenberg only. As this is an upgrade for 5.9.0 (with 5.8 in a separate branch), this function can renamed for 590
.
Then it can be renamed for each future release with the appropriate compatible/incompatible Gutenberg plugin versions.
@
3 years ago
Removes unnecessary _upgrade_580_force_deactivate_incompatible_plugins()
AND fixes the GB version comparison to trigger at < 11.8.
#12
@
3 years ago
Test Report
env:
- OS: macOS
- localhost: Local
- Plugins: Beta Tester, Core Rollback, Gutenberg (various versions)
- Browser: Firefox, Chrome, Safari, Edge (though browser doesn't really matter)
Steps
Note: You can download different Gutenberg plugin versions from here https://wordpress.org/plugins/gutenberg/advanced/
- Start with WordPress 5.8.2
- Install Gutenberg 11.7 (which also has the
WP_Theme_JSON_Schema
interface conflict in it) and activate it - Go to Tools > Beta Testing and set these settings: "Bleeding edge" and "Nightlies". Press save.
- Go to Dashboard > Updates
- Click the "Update to latest 5.9 nightly" blue button
Result: 5.9 installs, no fatal error, and Gutenberg plugin is deactivated (check by going to Plugins)
- Roll WordPress back to 5.8.2 by going to Dashboard > Updates and clicking the "Re-install version on 5.8.2" button.
- Go to Plugins and delete the Gutenberg plugin.
- Install and activate Gutenberg 11.8.0.
- Click "Add New" and then "Upload Plugin". Drag and drop or select the 11.8.0 version of the Gutenberg plugin.
- Click "Install Now".
- Once installed, click to activate it.
- Repeat steps 4 and 5.
Results: Fatal error.
Bummer. Why? The version_compare()
of <= 11.8
doesn't work when the version is 11.8.x. See it in action here https://3v4l.org/BGVJo.
54405.diff changes to use < 11.9
for the version_compare()
.
#13
follow-up:
↓ 16
@
3 years ago
@johnbillion @SergeyBiryukov @johnbillion are you okay with removing _upgrade_580_force_deactivate_incompatible_plugins()
? It makes sense to me as there are no other plugins being deactivated and this function is not needed for 5.9.
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
3 years ago
#15
@
3 years ago
I think that's fine, the new 590-function would deactivate the older version that the 580 one handled, so no need to keep both.
#16
in reply to:
↑ 13
@
3 years ago
Replying to hellofromTonya:
are you okay with removing
_upgrade_580_force_deactivate_incompatible_plugins()
? It makes sense to me as there are no other plugins being deactivated and this function is not needed for 5.9.
This is an interesting precedent as we don't generally remove functions, but it seems fine in this case, and makes sense to me too. 54405.diff looks good here.
Previously: #53432 for 5.8.