Widgets: Temporary fix for saving widgets#28078
Merged
draganescu merged 2 commits intomasterfrom Jan 11, 2021
Merged
Conversation
|
Size Change: +82 B (0%) Total Size: 1.3 MB
ℹ️ View Unchanged
|
Fixes two issues with saving widgets on the widgets screen: 1. Unable to save a new widget. What's happening here is that `saveEntityRecord()` passes execution back to `saveWidgetArea()` before it has a chance to call `addToBatch`. This means that nothing is in the batch processing queue when `processBatch()` is called. The temporary fix is to wait for a promise before calling `processBatch()`. This allows execution in `saveEntityRecord()` to resume. 2. Unable to save existing widgets. What's happening here is that the client IDs are changed by `useBlockSync()`. This breaks the internal mapping that the widget editor maintains of widget IDs <-> block client IDs. The temporary fix is to have the widgets editor pass a prop to `useBlockSync()` that disables cloning blocks.
c768f92 to
f11024f
Compare
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Temporary fix for two regressions that prevent saving widgets in the widgets screen. This screen is currently shown to all users of the Gutenberg plugin.
While I work on fixing this properly, I want to ship a temporary fix in 9.8 as these are very prominent regressions that are resulting in a lot of comments from users in #27173 and in the support forums. It also unblocks work on the widgets screen.
Fixes two issues with saving widgets on the widgets screen:
Unable to save a new widget. What's happening here is that
saveEntityRecord()passes execution back tosaveWidgetArea()before it has a chance to calladdToBatch. This means that nothing is in the batch processing queue whenprocessBatch()is called. The temporary fix is to wait for a promise before callingprocessBatch(). This allows execution insaveEntityRecord()to resume. See Widgets editor: "There was an error. object Object" on save #27173 (comment).Unable to save existing widgets. What's happening here is that the client IDs are changed by
useBlockSync(). This breaks the internal mapping that the widget editor maintains of widget IDs ↔ block client IDs. The temporary fix is to have the widgets editor pass a prop touseBlockSync()that disables cloning blocks. See Allow using multiple controlled inner blocks refering to the same entity #27885 (comment).