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

Meta box reordering does not save in user preferences #30071

Closed
peterwilsoncc opened this issue Mar 22, 2021 · 6 comments · Fixed by #30617
Closed

Meta box reordering does not save in user preferences #30071

peterwilsoncc opened this issue Mar 22, 2021 · 6 comments · Fixed by #30617
Assignees
Labels
[Feature] Meta Boxes A draggable box shown on the post editing screen [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@peterwilsoncc
Copy link
Contributor

peterwilsoncc commented Mar 22, 2021

Description

Originally reported as WP#52818 by wordpress.org user terraling

Post edit screens with metaboxes allow for drag and drop re-ordering.

This worked up to WordPress 5.6.2, but stopped working in WP 5.7, though it continues to work if you use the Classic Editor to edit posts rather than the block editor.

When re-ordering the metaboxes, an ajax update with the action 'meta-box-order' occurs, and this reports a succesful response both in the working and non-working cases, so it appears as if updating the metabox order works.

But, when the page is reloaded, the metaboxes are displayed in an unchanged order.

At the moment this is on the WP 5.7.1 milestone but please let me know if this isn't possible.

Step-by-step reproduction instructions

  1. Create a legacy meta box with this code in a plugin https://gist.github.com/peterwilsoncc/65e80a277a1ac1d1d700502638d80fb3
  2. Create a new post
  3. Enable the custom fields panel
  4. You should see two meta boxes at the bottom of the screen
  5. Reordeer the two meta boxes, either by dragging and dropping or clicking the buttons
  6. Refresh the editor
  7. Observe the two meta boxes are not showing in the user's selected order.

Expected behaviour

At the final step the order should reflect the user's preferences.

Actual behaviour

The order of meta boxes is reset to the default WP order each time the editor is loaded.

@desrosj has determined that the page parameter is been left off the AJAX request to the admin-ajax action meta-box-order.

A git bisect shows it was apparently introduced in this package update during the WP 5.7 cycle WordPress/wordpress-develop@bc40569.

Screenshots or screen recording (optional)

ffs-apple.mov

Code snippet (optional)

WordPress information

  • WordPress version: 5.7.0
  • Gutenberg version: latest (built from 49c6fb9 )
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes, TT1

Device information

  • Device: Desktop
  • Operating system: macOS 11.2.1
  • Browser: Firefox Developer Edition 87
@peterwilsoncc peterwilsoncc added [Feature] Meta Boxes A draggable box shown on the post editing screen [Type] Bug An existing feature does not function as intended labels Mar 22, 2021
@vlad-timotei
Copy link
Contributor

Most probably, another problem caused by the missing page parameter in the request to the admin-ajax is with closed-postboxes action, resulting in failing to save the closed status of metaboxes. (see this forum topic)

@paaljoachim
Copy link
Contributor

paaljoachim commented Mar 26, 2021

These might be associated:

No way to drag metabox back into sidebar / below content if there are no other metaboxes there
#7960
PR: #25187

Meta box back-compat concurrency.
#10711

Meta boxes: update core styles to match Gutenberg's
#12101

EDIT: 8th April.
This issue might also be associated:
Persist user's editor preferences to database rather than local storage
#15105

@peterwilsoncc peterwilsoncc added the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Apr 6, 2021
@peterwilsoncc
Copy link
Contributor Author

I've labelled this for backporting and moved in on to the 5.7.x project board.

With WP 5.7.1 RC due later this week, you may wish to bump this to the .2 release. Please advise and I will move WP#52818 accordingly.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Apr 8, 2021
@rodrigo-arias
Copy link

Hi, is there any chance this will be released before 5.7.2 in the standalone plugin? I am not worried about the metabox ordering, but in my case using ACF, after selecting a taxonomy, the rest of the metaboxes do not respond. Going back to 5.6.3 solves the problem. Thanks

@peterwilsoncc
Copy link
Contributor Author

@vlad-timotei I've confirmed #30617 fixes both the order and open/close state described in the linked forum post. I can see the post type is included in each of the relevant admin-ajax requests.

@rodrigo-arias
Copy link

rodrigo-arias commented May 11, 2021

Hi, thank you for your work here. I have seen that they continue to work on a PR, do they have an ETA of when it will merged? As a workaround I have rollback to 5.6 several sites.

@Mamaduka Mamaduka removed the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Meta Boxes A draggable box shown on the post editing screen [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants