-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Blocks with post meta attributes stopped working after update 6.6.0 #17767
Comments
cc @epiqueras |
Hi @razwan, I can't reproduce this. Something in your setup is causing the post object returned from the API to not have a |
i'm seeing the same thing - both on an existing setup that has a block with meta sources, along with a fresh install using gutenberg 6.6.0 and no other plugins |
Can you try logging/inspecting the result of the REST API call for fetching the post when the editor loads. For some reason the If this is the case, we'll need to think about where to throw an error when that happens, because other parts of the codebase might assume that it is there and fail in different ways. |
hey @epiqueras I've tested on a fresh installation of WordPress 5.2.3 where I've only installed Gutenberg 6.6.0 and the plugin I mentioned above. I created a new post and the only REST API calls made when the editor loads are made to
when i try to add a block two more request are made to
and if I try to add the test block I made the editor crashed. The preloaded data used in the "\/wp\/v2\/pages\/8?context=edit": {
"body": {
"id": 8,
"date": "2019-10-07T06:39:31",
"date_gmt": "2019-10-07T06:39:31",
"guid": {
"rendered": "http:\/\/gutenbergtest.local\/?page_id=8",
"raw": "http:\/\/gutenbergtest.local\/?page_id=8"
},
"modified": "2019-10-07T06:41:20",
"modified_gmt": "2019-10-07T06:41:20",
"password": "",
"slug": "gutenberg-test",
"status": "publish",
"type": "page",
"link": "http:\/\/gutenbergtest.local\/gutenberg-test\/",
"title": {"raw": "Gutenberg test", "rendered": "Gutenberg test"},
"content": {
"raw": "<!-- wp:paragraph -->\n<p>Test paragraph<\/p>\n<!-- \/wp:paragraph -->",
"rendered": "\n<p>Test paragraph<\/p>\n",
"protected": false,
"block_version": 1
},
"excerpt": {"raw": "", "rendered": "<p>Test paragraph<\/p>\n", "protected": false},
"author": 1,
"featured_media": 0,
"parent": 0,
"menu_order": 0,
"comment_status": "closed",
"ping_status": "closed",
"template": "",
"meta": {"my_block_meta": 0},
"permalink_template": "http:\/\/gutenbergtest.local\/%pagename%\/",
"generated_slug": "gutenberg-test",
"_links": {
"self": [{"href": "http:\/\/gutenbergtest.local\/wp-json\/wp\/v2\/pages\/8"}],
"collection": [{"href": "http:\/\/gutenbergtest.local\/wp-json\/wp\/v2\/pages"}],
"about": [{"href": "http:\/\/gutenbergtest.local\/wp-json\/wp\/v2\/types\/page"}],
"author": [{"embeddable": true, "href": "http:\/\/gutenbergtest.local\/wp-json\/wp\/v2\/users\/1"}],
"replies": [
{
"embeddable": true,
"href": "http:\/\/gutenbergtest.local\/wp-json\/wp\/v2\/comments?post=8"
}
],
"version-history": [
{
"count": 2,
"href": "http:\/\/gutenbergtest.local\/wp-json\/wp\/v2\/pages\/8\/revisions"
}
],
"predecessor-version": [
{
"id": 10,
"href": "http:\/\/gutenbergtest.local\/wp-json\/wp\/v2\/pages\/8\/revisions\/10"
}
],
"wp:attachment": [{"href": "http:\/\/gutenbergtest.local\/wp-json\/wp\/v2\/media?parent=8"}],
"wp:action-publish": [{"href": "http:\/\/gutenbergtest.local\/wp-json\/wp\/v2\/pages\/8"}],
"wp:action-unfiltered-html": [{"href": "http:\/\/gutenbergtest.local\/wp-json\/wp\/v2\/pages\/8"}],
"wp:action-assign-author": [{"href": "http:\/\/gutenbergtest.local\/wp-json\/wp\/v2\/pages\/8"}],
"curies": [{"name": "wp", "href": "https:\/\/api.w.org\/{rel}", "templated": true}]
}
}, "headers": {"Link": "<http:\/\/gutenbergtest.local\/gutenberg-test\/>; rel=\"alternate\"; type=text\/html"}
}, |
@epiqueras sorry for the misinformation, I guess I overlooked that aspect. I'm glad I could help and that this got fixed in such a short time. Thanks! |
It wasn't misinformation 😄 A page is still a |
Describe the bug
The 6.6.0 update seems to cause an issue where the editor breaks when I add blocks that use post meta as source for one of their attributes.
I've created a small plugin to test this and got the same result:
The error comes from the withMetaAttributeSource filter here
To reproduce
Steps to reproduce the behavior:
Trace
Additional context
Gutenberg 6.6.0
The text was updated successfully, but these errors were encountered: