[wp-trac] [WordPress Trac] #53432: Fatal error during update to 5.8 of a site with an active Gutenberg plugin (version less than 10.7) (was: Fatal error during update to 5.8 of a site with an active Gutenberg plugin (version less than 10.8.4))
WordPress Trac
noreply at wordpress.org
Thu Jun 17 23:48:16 UTC 2021
#53432: Fatal error during update to 5.8 of a site with an active Gutenberg plugin
(version less than 10.7)
-----------------------------------------+-----------------------------
Reporter: oglekler | Owner: hellofromTonya
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.8
Component: Upgrade/Install | Version: trunk
Severity: normal | Resolution:
Keywords: has-screenshots needs-patch | Focuses:
-----------------------------------------+-----------------------------
Changes (by hellofromTonya):
* keywords: has-screenshots => has-screenshots needs-patch
* owner: (none) => hellofromTonya
* status: new => assigned
Comment:
I was able to reproduce the problem with Gutenberg plugin versions less
than 10.7, but not with 10.7+.
Why does this happen?
The plugin already has the class loaded into memory. With 5.8, the class
has been merged into core and is loaded by core. When updating to 5.8,
there's a naming conflict as PHP does not allow overwriting a class (or
function, trait, constant, etc.) once it's in memory. In this case, it's
already in memory (via the plugin) when core tries to load it. Fatal
error.
Different solutions were discussed in slack
([https://wordpress.slack.com/archives/C02RQBWTW/p1623965403246200 see the
thread here]) including guarding the load circuit in core. But a simple
solution was proposed using [https://github.com/WordPress/wordpress-
develop/blob/master/src/wp-admin/includes/update-core.php#L1660 a similar
approach as this] to deactivate the Gutenberg plugin when the version is
not compatible. In this case, < 10.7 is not compatible with WP 5.8. This
solution would prevent other potential fatal errors of other files loaded
later that might also be incompatible.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53432#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list