Problem/Motivation
Following the upgrade to 3.0.x, (I think it might be related to this upstream change) - custom preferences are no longer persisted since data.plugins.persistence.__unstableMigrate() is now a noop.
And potentially the #3402817: Override registerCoreBlocks() with the gutenberg/overrides dependencies pulling in certain dependencies before the data persistence has been configured.
Steps to reproduce
Turn off Fullscreen mode and refresh the page.
It previously persisted the fullscreen preferences in your local storage. However it currently doesn't, forcing the page to always be in fullscreen mode.
Proposed resolution
Update the library dependency hierarchy ensuring that the data persistence plugin is loaded before the block editor is initialized. Or otherwise find out which breaking API change needs to be addressed.
Remaining tasks
Investigate and provide MR.
User interface changes
Minimal. But existing UI customizations should be persisted where relevant.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 3414998-updating-failed.png | 27.71 KB | marcofernandes |
Issue fork gutenberg-3414998
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
codebymikey commentedComment #3
codebymikey commentedFound the real upstream issue https://github.com/WordPress/gutenberg/pull/39795.
It seems https://git.drupalcode.org/project/gutenberg/-/blob/a699656a/js/data.js#L7 is now a noop.
In particular, this change, where the local settings are now stored in the database rather than local storage.
The equivalent API in Drupal would bePrivateTempStore.The question is whether we should update the logic such that we keep persisting data in localStorage or in the database
Comment #4
marcofernandes commentedI think we would first fix storing the preferences to localstorage and then create a feature request to move to the database.
Comment #6
codebymikey commentedProvided a fix maintaining storage within
localStorage, and if we need to persist the user preferences in database, then that can be done using theUserDataservice later.Additional reference for the API: https://www.webomelette.com/storing-user-data-such-preferences-drupal-8-...
Comment #8
codebymikey commentedComment #9
marcofernandes commentedNoticed now that this is appearing after this change:

Comment #15
marcofernandes commentedFor now, I reverted the code at api-fetch.js that caused the issue. Preferences are still persisted.
Comment #17
marcofernandes commented