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

Merge conflicting wp.editor objects into a single, non-conflicting module #1481

Closed
wants to merge 3 commits into from

Conversation

adamziel
Copy link
Contributor

@adamziel adamziel commented Jul 7, 2021

Description

Solves WordPress/gutenberg#33203
Solves https://core.trac.wordpress.org/ticket/53437
Related to https://core.trac.wordpress.org/ticket/53569

Situation: packages/editor is exposed as window.wp.editor in wp-admin

Problem: there is quite some code expecting to see a different (legacy) object under window.wp.editor

Proposed solution: export all the members of legacy window.wp.editor from this new module to maintain backward compatibility

As @noisysocks noticed in WordPress/gutenberg#33228:

Makes me wonder if a “fix” could be to add code to Core which fires off doing_it_wrong() if you enqueue wp-editor or wp-edit-post in the widgets screen.

This is addressed in #1484

How has this been tested?

  1. Activate classic widgets plugins.
  2. Insert text widget
  3. Add some text to widget.
  4. Deactivate classic widgets plugins.
  5. Go to widget screen.
  6. There is an error message if this PR is not applied.
  7. There are no error messages if this PR is applied.

Screenshots

124498441-3f40df80-ddb4-11eb-99e1-581b287f96de

(Credits for the screenshot and the test plan to @spacedmonkey)

Types of changes

Bug fix (non-breaking change which fixes an issue)

Co-authored-by: Robert Anderson <robert@noisysocks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants