WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 3 months ago

#53762 closed enhancement (fixed)

Replace the remaining references to wp.editor with wp.oldEditor

Reported by: zieladam Owned by: azaozz
Milestone: 5.8.1 Priority: highest omg bbq
Severity: normal Version:
Component: Editor Keywords: has-patch commit fixed-major
Focuses: Cc:

Description (last modified by SergeyBiryukov)

In #53437 we replaced some references to wp.editor (the legacy TinyMCE one) with wp.oldEditor (thanks to @spacedmonkey). In this ticket we replace the remaining references.

The long-term goal is to resolve the conflicts with wp.editor, the Gutenberg module. We cannot fully remove wp.editor (the legacy TinyMCE one) because many plugins depend on it. We can, however, deprecate it.

Step 1: wp.editor but replace references to wp.editor with wp.oldEditor
Step 2: Deprecate wp.editor, add a dev note
Step 3: Phase out wp.editor (the legacy TinyMCE one)

cc @noisysocks @desrosj @spacedmonkey

Attachments (4)

53762.diff (870 bytes) - added by azaozz 3 months ago.
53762.2.diff (488 bytes) - added by SergeyBiryukov 3 months ago.
53762.3.diff (2.0 KB) - added by azaozz 3 months ago.
53762.4.diff (6.8 KB) - added by azaozz 3 months ago.

Download all attachments as: .zip

Change History (23)

#2 @SergeyBiryukov
4 months ago

  • Component changed from General to Editor
  • Description modified (diff)
  • Milestone changed from Awaiting Review to 5.8.1

#4 @spacedmonkey
4 months ago

@zieladam Thanks for the ticket. I had in my mind to create it myself.

For extra context, @desrosj already commited a patch for me in aid of this. See [51409].

I think we should commit #1516 in WordPress 5.8.1 and looking at Deprecate wp.editor in 5.9. I don't think we should be deprecating stuff in point releases.

I think we should add a call to the deprecated package when calling wp.editor.initialize. However, I think try and keep the functionality working. Let developers see the deprecated message and give them sometime to fix it. After a couple of releases, then we finally remove it.

Last edited 3 months ago by SergeyBiryukov (previous) (diff)

#5 @zieladam
4 months ago

I think we should commit #1516 in WordPress 5.8.1 and looking at Deprecate wp.editor in 5.9. I don't think we should be deprecating stuff in point releases.

Absolutely agreed! Let's prepare a WP 5.9 PR/Ticket related to the deprecated call once PR 1516 lands.

#6 @zieladam
3 months ago

  • Keywords commit added; dev-feedback removed

https://github.com/WordPress/wordpress-develop/pull/1516 was approved by @azaozz so I'm adding the commit keyword

#7 @azaozz
3 months ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 51649:

Editor: Replace the remaining references to wp.editor with wp.oldEditor.

Props zieladam.
Fixes #53762.

#8 @azaozz
3 months ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopen for 5.8.1.

#9 @desrosj
3 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 51656:

Editor: Replace the remaining references to wp.editor with wp.oldEditor.

Props zieladam, azaozz.
Merges [51649] to the 5.8 branch.
Fixes #53762.

#10 @azaozz
3 months ago

  • Priority changed from normal to highest omg bbq
  • Resolution fixed deleted
  • Status changed from closed to reopened

There seems to be a regression here. This line

window.wp.editor = window.wp.oldEditor = window.wp.oldEditor || {};

overwrites wp.editor with wp.oldEditor. The old code was just adding to wp.editor:

window.wp.editor = window.wp.editor || {};
window.wp.editor.getDefaultSettings = function() {
...

Patch coming up.

@azaozz
3 months ago

#11 @azaozz
3 months ago

In 53762.diff: fix the overwriting of wp.editor with wp.oldEditor in the inline script outputted when enqueuing the old editor. Add getDefaultSettings() to both for full back-compat.

#13 @azaozz
3 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 51748:

Editor: fix the replacement of wp.editor with wp.oldEditor in the inline script outputted when enqueueing the old editor.

Props fullofcaffeine, davidbinda, grantmkin, get_dave, azaozz.
Fixes #53762.

#14 @SergeyBiryukov
3 months ago

In 51749:

Editor: fix the replacement of wp.editor with wp.oldEditor in the inline script outputted when enqueueing the old editor.

Props fullofcaffeine, davidbinda, grantmkin, get_dave, azaozz.
Merges [51748] to the 5.8 branch.
Fixes #53762.

#15 @david.binda
3 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

@azaozz I’ve just gave the latest patch ( [51749] ) a try in my test environment, and I’m not sure that it really fixes all the issues we have seen.

Feels like perhaps there is one more place where the wp.editor is being overridden with the wp.oldEditor.

Looks like the change in https://build.trac.wordpress.org/changeset/51255/#file2 on line 8 has the same effect as the one which was patched in [51749]

Last edited 3 months ago by SergeyBiryukov (previous) (diff)

@azaozz
3 months ago

@azaozz
3 months ago

#16 @azaozz
3 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 51768:

Editor: Revert [51748] and [51649]. They intorduced a bug where wp.editor may be replaced with wp.oldEditor in certain cases.

Props desrosj, davidbinda, azaozz.
Fixes #53762.

#17 @azaozz
3 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopen for the 5.8 branch.

#18 @desrosj
3 months ago

[51768] looks good to backport @azaozz.

#19 @azaozz
3 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 51770:

Editor: Revert [51748] and [51649]. They intorduced a bug where wp.editor may be replaced with wp.oldEditor in certain cases.

Props desrosj, davidbinda, azaozz.
Merges [51768] to the 5.8 branch.
Fixes #53762.

Note: See TracTickets for help on using tickets.