-
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
Widgets editor: "There was an error. object Object" on save #27173
Comments
i can confirm this issue with 5.5.3 german. |
I can confirm this issue with gutenberg 9.4.1 and WP 5.5.3 when trying to save any type of block in the widget area. Request headers: Request payload: Response: |
I can reproduce this issue consistently in What is shown in this GIF:
Investigating this a bit further, the When adding the new block between existing blocks: When adding the new block after existing blocks: I could reproduce the issue above with themes Twenty Twenty and Storefront with WP 5.6. |
+1, can reproduce this issue with latest WordPress |
Similar issue here, but maybe I can add a little more context. I've tried with both Further, in the sidebar are 2 classic widgets: Search Widget and Recent Posts Widget. (These were in the sidebar before adding and activating the gutenberg plugin) If I update the title of the Search Widget, the Update button becomes available and clicking on it saves everything as one would expect. If I manually refresh the screen, the adjusted title is present. Nice! However, if I try to update the title of the Recent Posts widget, the update button becomes available again, but when pressed, a notification of 'widgets saved' is shown, and the update button is stuck on "Saving..." -- nothing appears in the Network tab, so it appears no request to the server is being made. If I refresh the page manually, the edited title is lost. Aww. If I try to add a new block (seemingly any, I've tried with paragraph, list, image, and another recent posts widget), the block is added to the sidebar. But upon pressing update, I see the error message folks have reported above. I've tried with WP Core 5.5.2 and 5.6 as well as Gutenberg 9.5.1 from the plugins repo and 9.5.2 available by cloning this repo and running |
…oving a bajillion dependencies and making sure we're up to date. Added start of widgets-related screen but currently blocked by core bug : WordPress/gutenberg#27173
Same issues with version 9.6.2 |
Can confirm that if I load up the Widgets screen, add a paragraph, click Update, I see that error. Happens with image blocks too. |
When the widget section is in its 'factory state' saving doesn't seem to POST to REST route /wp/v2/sidebars/sidebar-1. When a Gutenberg text block is added before the existing widgets, saving is successful with the following POST payload:
When a Gutenberg text block is added after the existing widgets, the error occurs and the payload is:
The error is a 400 (rest_invalid_param), stating that array value at index 3 should be an object or a string |
I did some debugging—I'm not that familiar with the code, so this requires some further insight. What seems to be happening:
So from what I can tell, the key bit that seems to go wrong is saving new widgets—this might be related to the batching system that widgets seem to use. I'd need to spend some more time looking at the code to understand how it works. |
Did a little digging as well. Haven't figured out what's causing this yet but I did notice while investigating this that #27885 resets all of the client IDs in |
I can confirm this is also happening with Gutenberg 9.7.0 & WP 5.6. When trying to save any widget, no matter the sidebar or position. For this test I have added a paragraph block and try to save on sidebar-1. Request Response
|
+1, this issue currently prevents me from using widgets with Gutenberg. |
So how this is supposed to work is:
The problem is that, in gutenberg/packages/core-data/src/actions.js Line 352 in b3620b5
This is totally fine and the the lock is granted right away. But because there’s a This means that by time Introducing any amount of async (think: I have two ideas:
|
I have the same problem. WP Core 5.5.1 Gutenberg 9.7.0. And have loop saving on button and the text error 'There was an error. object Object'. |
A temporary fix was added in #28078 which will ship as part of Gutenberg 9.8. Keeping this issue open to track implementing a more permanent fix. |
Describe the bug
In the widgets area, I do not get access to the Save button unless i duplicate a whole block and then edit that save everything and then go back and delete the original block.
Since the last gutenberg update even after duplicating the block and editing it, when i get the save button, it changes to Saving ... and in the bottom left i get a very quick error message saying "There was an error. object Object"
Having googled and checked here, i can confirm i get access to wp-json with no issue
and as soon as i deactivate Gutenburg plugin, go back to the block editor ... i paste the text in where i want it, hit save and all done.
To reproduce
Steps to reproduce the behavior:
Error message : "There was an error. object Object"
and the save button sticks on "Saving"
Expected behavior
Well i have been living with the having to duplicate edit, save, return, delete old copy, save again, check ...
But clearly i would prefer the save to work with out having to go through all of that. Just a working save button after i edit some thing would be better.
Screenshots
If applicable, add screenshots to help explain your problem.
Editor version (please complete the following information):
Desktop (please complete the following information):
Additional context
Hosted on 20i's wordpress cloud.
With jetpack installed
The text was updated successfully, but these errors were encountered: