WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.53k stars 4.21k forks source link

Hiding all metaboxes prevents `POST` request to `post.php` to save meta fields #67207

Open enricobattocchi opened 16 hours ago

enricobattocchi commented 16 hours ago

Description

Since WordPress 6.7, when all the metaboxes are hidden in the preferences, the POST request to post.php to save meta fields is not fired anymore as it used to (e.g. in 6.6.2). This creates problems with plugins, e.g. Yoast SEO, that use a sidebar to allow users to change some post metadata. In general, this is a different behaviour from what used to happen so any mechanism relying on that request being fired could be affected.

Step-by-step reproduction instructions

  1. Have WordPress 6.7.* on your site
  2. Install and activate only one plugin adding metaboxes, e.g. Yoast SEO
  3. In the block editor, Preferences > General > Advanced, disable "Yoast SEO" and close
  4. important: reload the page or edit another post - the metabox needs to be hidden from the beginning
  5. open the Yoast SEO sidebar and change a setting, e.g. the focus keyphrase
  6. save the post
  7. no POST request is fired to post.php, so the changed value is not saved

Up until 6.6.2, a POST request was fired to post.php even with hidden metaboxes, so the new value was saved.

Important to notice: the value change in the hidden field works as expected, only the POST request is not fired anymore.

Notable finding: if the user visits Preferences > General > Advanced, enables the metabox and then disables it again, then doesn't reload the page, the changed value will be saved instead. The problem happens only if all metaboxes are hidden since the editor page has been loaded and the relevant settings have not been touched.

Screenshots, screen recording, code snippet

https://www.loom.com/share/bdf879f26d67454caca89aa7b6c3de0b (created by a Yoast support engineer for this issue)

Environment info

Please confirm that you have searched existing issues in the repo.

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Please confirm which theme type you used for testing.