Blocks Not saving after update
-
Hi,
I’m having a problem after yesterdays update. When I try to create a new block, it seems to work and I get the message as the “page was published” and the instructions to create the template, but when I try to open the newly created block (to edit) it is totally blank, as if nothing would have been saved to database. The block shows in the block list with the right title, but it is empty.
My site is hosted in Pantheon, and that may be important (Pantheon is not a regular LAMP server stack). I also have a local (non-pantheon) WP install, and that one seems to work fine. Also, the previous version was working fine in my Pantheon install.
Did as much troubleshooting as possible (disable/enable, uninstall/reinstall, cloned the environment and tested… same problem).
I hope you can help!! Thanks!!
-
Hi @garciagali,
Thanks a lot for letting me know about that.1. Could you please share a screenshot of what this looks like:
…but when I try to open the newly created block (to edit) it is totally blank, as if nothing would have been saved to database. The block shows in the block list with the right title, but it is empty.
2. Is there any console error in Gutenberg?
3. Could you please go to the page where you created the block (not Gutenberg), run this in the JS console, and paste the result for me:
wp.data.select( 'core/editor' ).getEditedPostContent()-
This reply was modified 5 years, 4 months ago by
Ryan Kienstra.
-
This reply was modified 5 years, 4 months ago by
Ryan Kienstra.
-
This reply was modified 5 years, 4 months ago by
Ryan Kienstra.
Well, if there is something I really hate is when your problem resolves itself the moment you open a support request…
It seems everything started working properly the moment I was going to follow your instructions…
Just as a reference, I was able to replicate what I was seeing yesterday in my Local Dev environment (Pantheon local clone that was showing the same behavior yesterday), and to assert I’m not crazy… π
I ranwp.data.select( 'core/editor' ).getEditedPostContent()there while it was still in error and the result was “”
One minute later I opened the same block and everything was right and the code returned an object with all the current data (fields, etc)I guess you can close this request. I’ll post something else if I start seeing some weird behavior.
Also, thanks for working on this plugin, it is really a life saver for me!!
No, wait, it’s happening again… π
Same behavior, create the block, publish, go back to the blocks list, open it, and totally blank… running `wp.data.select( ‘core/editor’ ).getEditedPostContent()’ returns “” no errors in the console or the WP editor…
go back, open it again, nothing, blank
go back open it again, nothing, blankgo back, open it again and suddenly all the fields and title are there…
Can it take minutes to save to the database?? weird…
Hm, interesting.
1. What’s the version of Core?
2. Is the Gutenberg plugin active, and if so, what version?Core version is 5.6
Not sure what you mean by Gutenberg plugin. Gutenberg is default after version 5, right? we are not using the Classic editor plugin (if that’s what you are asking)
Theme: Divi (actively working on replace it with Genesis Custom child theme)My gut feeling tells me that it may have something to do with the containerized infrastructure that Pantheon works with (permissions and write options are very different from a typical LAMP server). It was not doing this at all in my local docker (non-Pantheon) WP
Thanks for your patience and details.
1. Have you tried this with a Core theme, like Twenty Twenty?
Of course, if it’s a production site, switching themes would be a hassle.
2. If you’re up for it, could you try this WP-CLI command whenever you see the bug:
wp post get <post id> --field=contentThe
<post id>will be in the URL: https://cldup.com/EWCCerkMfH.pngIt should be a JSON blob with fields, like you mentioned above.
All good about the Gutenberg plugin: https://ww.wp.xz.cn/plugins/gutenberg/
If it doesn’t sound familiar, you’re probably not using it. The functionality from the Gutenberg plugin is already in Core, it’s like a ‘beta tester’ plugin for new editor features.
Hm, interesting about containerized infrastructure.
That’s strange, I don’t see the bug on a Pantheon site, but I’ll keep testing: http://dev-kienstra.pantheonsite.io
-
This reply was modified 5 years, 4 months ago by
Ryan Kienstra.
-
This reply was modified 5 years, 4 months ago by
Ryan Kienstra.
Hi, I ran the cli command you requested and this is what it returns:
{"genesis-custom-blocks/test-3":{"name":"test-3","title":"test 3","excluded":[],"icon":"genesis_custom_blocks","category":{"icon":null,"slug":"text","title":"Text"},"keywords":[],"fields":{"test":{"location":"editor","width":"100","help":"","default":"","placeholder":"","maxlength":"","name":"test","label":"test","control":"text","type":"string","order":0}}}}I open the block and it still shows up blank, as if I was clicking on the “Add New” button, so much that instead of an “Update” Button, it has a “Publish” button (It was already published, and I’m clicking on the title link in the block list)
wp.data.select( 'core/editor' ).getEditedPostContent()still returns “”
opening and closing the block at least 3 times seems to do the trick, and then everything works fine…May be something with my db?? some corruption or something?? I tested on a local Pantheon site from a Multidev environment cloned from our production site.
I activated the twenty twenty theme (is not a production environment) and it still having the same behavior…
-
This reply was modified 5 years, 4 months ago by
garciagali.
Hi @garciagali,
Thanks, that helps a lot.It looks like that post is saved fine on the back-end.
That JSON blob looked good when I created a block in my local with it:
https://cldup.com/O0HjSVnRqp.pngSorry, could you run another JS console snippet when the bug appears?
JSON.stringify( wp.data.select( 'core' ).getEditedEntityRecord( 'postType', 'genesis_custom_block', wp.data.select( 'core/editor' ).getCurrentPost().id ) )That’ll show how the post is available in the React app.
Thanks so much for your patience.
Hm, I can reproduce this on Firefox on Pantheon now.
Sure,
happy to help!!Just to make sure that we are in the same page, all this error happens in the admin dashboard, not in the front-end.
When I create the block in the block editor, everything seems to go well (successfully published), then I go back to the block list (All Blocks in the Custom Blocks section of the admin dashboard. The new block is listed and when I click on the link to open the block editor, the block seems to be blank (no title, no fields and a Publish button. It has an ID in the url, though).
I repeated the process and ran the js code you asked, this is the response:
"{"id":29518,"date":"2021-01-28T13:46:17","date_gmt":"2021-01-28T21:46:17","guid":"https://[local url].pantheonlocal.com/?post_type=genesis_custom_block&p=29518","modified":"2021-01-28T13:46:17","modified_gmt":"2021-01-28T21:46:17","password":"","slug":"","status":"auto-draft","type":"genesis_custom_block","link":"https://[local url].pantheonlocal.com/?post_type=genesis_custom_block&p=29518","title":"","content":"","parent":0,"template":"","meta":{"_links_to":"","_links_to_target":""},"_links":{"self":[{"href":"https://[local url].pantheonlocal.com/wp-json/wp/v2/genesis_custom_block/29518"}],"collection":[{"href":"https://[local url].pantheonlocal.com/wp-json/wp/v2/genesis_custom_block"}],"about":[{"href":"https://[local url].pantheonlocal.com/wp-json/wp/v2/types/genesis_custom_block"}],"wp:attachment":[{"href":"https://[local url].pantheonlocal.com/wp-json/wp/v2/media?parent=29518"}],"wp:action-publish":[{"href":"https://[local url].pantheonlocal.com/wp-json/wp/v2/genesis_custom_block/29518"}],"wp:action-unfiltered-html":[{"href":"https://[local url].pantheonlocal.com/wp-json/wp/v2/genesis_custom_block/29518"}],"curies":[{"name":"wp","href":"https://api.w.org/{rel}","templated":true}]}}"I edited the urls out of caution with [local url]
This is a local Pantheon environment, but the cloud ones behaves the same.
I hope it helps!
I am using Chrome on a Mac
sorry this issue seems to be a weird one… π
Thanks!
Just to make sure that we are in the same page, all this error happens in the admin dashboard, not in the front-end.
Thanks, that’s right!
Thanks a lot for pasting that. It has a status of auto-draft, it’s like the editor is creating a new post entirely.
It probably looks like this when you go back to the block that was saved, right?
https://cldup.com/1aMVDu6N-a.png
What browser are you using?
Yes, it looks exactly like that!!
Chrome (v88.0.4324.96 ) in a Mac.
Ah, interesting. Chrome.
If it’s alright, I’ll ping you here if/when I have a fix for you to test, assuming I can keep reproducing it.
Thanks so much for letting me know about this.
Hi,
Work for me!!
Thank you for working on this!!
I’ll keep an eye on this!!
-
This reply was modified 5 years, 4 months ago by
The topic ‘Blocks Not saving after update’ is closed to new replies.