Skip to content
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

Data: Avoid unsetting insertUsage preference in block editor migration #14691

Merged
merged 2 commits into from
Mar 29, 2019

Conversation

aduth
Copy link
Member

@aduth aduth commented Mar 28, 2019

Fixes #14580

This pull request seeks to remove logic which would unset the insertUsage preference when migrating preferences to the block-editor module introduced in #13088 . This intends to resolve an issue where downgrading to an earlier version or deactivating the plugin could result in an editor crash due to the missing property.

Testing instructions:

  1. (Prerequisite) Update to WordPress v5.1.1
    • In other words, be running the latest version, or at least not WordPress v5.2.0-beta.1
  2. Deactivate Gutenberg from the Plugins screen
  3. Navigate to Posts > Add New
  4. Clear localStorage
    • localStorage.clear() in your Developer Tools Console
  5. Reload
  6. Click on the writing prompt
    • This initializes the insertUsage preference in core/editor.
  7. Activate Gutenberg plugin from the Plugins screen
    • Make sure the plugin is a built version of this branch.
  8. Navigate to Posts > Add New
    • You don't need to take any action, just visit. The preference migration takes place automatically.
  9. Deactivate Gutenberg from the Plugins screen
  10. Navigate to Posts > Add New
  11. Click the Inserter
  12. Verify that no error occurs

@aduth aduth added [Type] Bug An existing feature does not function as intended [Package] Data /packages/data labels Mar 28, 2019
@aduth aduth requested review from youknowriad and gziolo March 28, 2019 19:35
@aduth aduth requested a review from nerrad as a code owner March 28, 2019 19:35
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's an eslint issue, but approving as it would be good to include in the next release and backport to WP 5.2

@gziolo
Copy link
Member

gziolo commented Mar 29, 2019

@youknowriad - how about 8b796e9? It should fix the issue.

@gziolo gziolo added this to the 5.4 (Gutenberg) milestone Mar 29, 2019
Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we can polish later, let's merge it and re-test in master branch :)

@gziolo gziolo merged commit 4b503ac into master Mar 29, 2019
@gziolo gziolo deleted the fix/14580-insert-usage-migration branch March 29, 2019 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Data /packages/data [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash occurs when state.preferences does not include insertUsage.
3 participants