WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 23 months ago

#45264 closed defect (bug) (fixed)

Fix the TinyMCE `wordpress` plugin to handle toolbars in the classic block

Reported by: azaozz Owned by: azaozz
Milestone: 5.0 Priority: high
Severity: normal Version:
Component: TinyMCE Keywords: has-patch commit
Focuses: Cc:

Description

As the title. The wordpress plugin throws errors in the classic block when the "Toggle Toolbars" (kitchensink) button is used. Also needs to handle toolbars show/hide there.

Attachments (3)

45264.diff (2.5 KB) - added by azaozz 2 years ago.
45264.2.diff (3.0 KB) - added by azaozz 2 years ago.
45264.3.diff (4.3 KB) - added by azaozz 2 years ago.

Download all attachments as: .zip

Change History (15)

@azaozz
2 years ago

#1 @azaozz
2 years ago

In 45264.diff: fix handling of toolbar toggle in the wordpress TinyMCE plugin.

This works together with https://github.com/WordPress/gutenberg/pull/10964, needs to be committed/merged at the same time :)

@azaozz
2 years ago

#2 @azaozz
2 years ago

In 45264.2.diff: small update after [43867].

#3 @azaozz
2 years ago

  • Keywords has-patch commit added

@azaozz
2 years ago

#4 @azaozz
2 years ago

In 45264.3.diff: also move the show/hide CSS to editor.css (like the rest of the styles for the classic block toolbars). This "fixes" toolbar toggling even with older versions of Gutenberg.

Last edited 2 years ago by azaozz (previous) (diff)

#5 @pento
2 years ago

In 43884:

Block Editor: Update @wordpress dependencies to the latest version.

Changes of note:

  • Includes the new Annotations API package.
  • wp-polyfill-ecmascript.js is renamed to wp-polyfill.js.
  • strip_dynamic_blocks() has been removed in favour of excerpt_remove_blocks().
  • The PHP block parser is now syncing from the block-serialization-default-parser package.
  • do_blocks() uses the new parser.
  • The do_block filter has been removed from do_blocks(), in favour of a render_block filter in render_block().

See #45145, #45190, #45264, #45282.

#6 follow-up: @pento
2 years ago

  • Keywords needs-refresh added; commit removed

@azaozz: The change from GB10964 has landed in Core.

The editor.css changes in 45264.3.diff should really only be in Gutenberg, Core will get them as part of the package import.

We don't need to worry about supporting old versions of the Gutenberg plugin in the 5.0 branch for this.

#7 in reply to: ↑ 6 @azaozz
2 years ago

Replying to pento:

The editor.css changes in 45264.3.diff should really only be in Gutenberg,

I don't mind either way. The idea is to completely remove this from Gutenberg once it starts to require WP 5.0, see https://github.com/WordPress/gutenberg/commit/b814d88612b7c1d4452508aeb9906c98605ca723#diff-f7875e8975dae92862deaf9e0231a93fR118.

The problem is that a new button was introduced to the classic block toolbar that looks the same as the "Toolbar toggle" button but works a bit differently. As far as I understand that was done because the wordpress TinyMCE plugin (a core file) needed couple of changes to better support that in Gutenberg.

This ticket fixes the existing wp_adv button to work as expected in the classic block and https://github.com/WordPress/gutenberg/pull/10964 fixes the new kitchensink button in the classic block so it's removable. That button will be supported for a bit longer and eventually removed.

Last edited 2 years ago by azaozz (previous) (diff)

#8 @pento
2 years ago

  • Keywords commit added; needs-refresh removed

Ah, I see. I thought the CSS was applying to the kitchensink button, but there's not much point in leaving that in Gutenberg if it's just going to be removed.

In that case, 45264.3.diff is good to go!

#9 @azaozz
2 years ago

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

In 43889:

Block Editor: Fix the TinyMCE wordpress plugin to handle hiding/showing of toolbars in the classic block. Change the classic block toolbar to use the (now fixed) wp_adv button.

Fixes #45264.

#10 @azaozz
2 years ago

In 43890:

Fix linting after [43889].

See #45264.

#11 @SergeyBiryukov
23 months ago

In 44247:

Block Editor: Fix the TinyMCE wordpress plugin to handle hiding/showing of toolbars in the classic block. Change the classic block toolbar to use the (now fixed) wp_adv button.

Props azaozz.
Merges [43889] and [43890] to trunk.
Fixes #45264.

#12 @desrosj
23 months ago

In 44261:

Block Editor: Update @wordpress dependencies.

Changes of note:

  • Includes the new Annotations API package.
  • wp-polyfill-ecmascript.js is renamed to wp-polyfill.js.
  • strip_dynamic_blocks() has been removed in favor of excerpt_remove_blocks().
  • The PHP block parser is now syncing from the block-serialization-default-parser package.
  • do_blocks() uses the new parser.
  • The do_block filter has been removed from do_blocks(), in favor of a render_block filter in render_block().

Also, a little cleanup to render_block(). Always normalize $block['attrs’] to array in ’render_block’ filter.
Props pento, azaozz.

Merges [43884] and [43888] to trunk.

See #45145, #45190, #45264, #45282.

Note: See TracTickets for help on using tickets.