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

Storing Post Meta with a Block is not working anymore (WordPress 5.4 beta) #20494

Closed
them-es opened this issue Feb 27, 2020 · 3 comments · Fixed by #20544
Closed

Storing Post Meta with a Block is not working anymore (WordPress 5.4 beta) #20494

them-es opened this issue Feb 27, 2020 · 3 comments · Fixed by #20544
Assignees
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability [Package] Editor /packages/editor [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@them-es
Copy link
Contributor

them-es commented Feb 27, 2020

This bug only seems to be related to WordPress 5.4 (beta) as it can't be reproduced on WordPress 5.3 (stable).

Steps to reproduce the behavior:

  1. Create a simple meta block based on the following tutorial: https://developer.wordpress.org/block-editor/tutorials/metabox/meta-block-1-intro/
  2. Add some text to the TextControl and save the post
  3. Reload the page and notice the empty TextControl
  4. The post meta key/value can't be found in the database

Desktop:

  • OS: macOS
  • Browser: Chrome/Firefox
  • Version: latest stable versions
  • Theme: TwentyTwenty

Additional context:

Working 😀

  • WordPress 5.3.2
  • WordPress 5.3.2 + Gutenberg 7.6

Not working 🙁

  • WordPress 5.4 beta3
  • WordPress 5.4 beta3 + Gutenberg 7.6
@aduth aduth added the Needs Testing Needs further testing to be confirmed. label Feb 27, 2020
@aduth
Copy link
Member

aduth commented Feb 27, 2020

In implementing a fix, there exists an end-to-end test which is intended to be capturing issues with this behavior. It should be updated to account for whatever is lacking to have caught whichever regression exists in meta behavior.

@jorgefilipecosta jorgefilipecosta added the [Type] Bug An existing feature does not function as intended label Feb 28, 2020
@aduth aduth added [Package] Editor /packages/editor Backwards Compatibility Issues or PRs that impact backwards compatability and removed Needs Testing Needs further testing to be confirmed. labels Feb 28, 2020
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 28, 2020
@aduth
Copy link
Member

aduth commented Feb 28, 2020

I confirmed the bug. It appears to specifically affect blocks where the JavaScript which registers the block in the editor is enqueued earlier than the editor itself.

A fix is proposed at: #20544

An interim workaround can be to change your script enqueue to take place in the footer (the fifth argument $in_footer of wp_enqueue_script).

@them-es
Copy link
Contributor Author

them-es commented Mar 2, 2020

Thank you for fixing that bug so quickly and for providing a workaround. Adding the true parameter in wp_enqueue_script is working as intended!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability [Package] Editor /packages/editor [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.

3 participants