WordPress.org

Make WordPress Core

Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#21350 closed defect (bug) (fixed)

Fatal error: Class '_WP_Editors' not found

Reported by: needle Owned by: azaozz
Milestone: 3.4.2 Priority: normal
Severity: normal Version: 3.4
Component: TinyMCE Keywords: has-patch
Focuses: Cc:

Description

When a theme makes use of TinyMCE on the front end and a language other than default en is chosen in wp-config.php, then WordPress 3.4.1 dies with:

Fatal error: Class '_WP_Editors' not found in /path/to/wp-includes/js/tinymce/langs/wp-langs.php on line 548.

Solution is to require the class-wp-editor.php file if not already included in function wp_mce_translation(). Patch attached.

Attachments (1)

21350.patch (430 bytes) - added by needle 21 months ago.

Download all attachments as: .zip

Change History (8)

needle21 months ago

comment:1 azaozz21 months ago

  • Keywords reporter-feedback added

Wondering how exactly the theme uses TinyMCE. The class is included when calling wp_editor() and tinymce/langs/wp-langs.php is not used if TinyMCE was used directly as a JS. The only call to wp-langs.php is in the _WP_Editors class.

Last edited 21 months ago by azaozz (previous) (diff)

comment:2 needle21 months ago

  • Keywords reporter-feedback removed

In common with many themes and plugins that predate wp_editor(), the theme makes use of a customised version of wp_tiny_mce() to enable TinyMCE on the comment textarea.

A quick search shows that, for example, BP GTM System, Rich Text Widget, MCEComments, Custom Fields, Quickpress all make use of this technique as well (not sure how many of those are current though). And searching for the string "Fatal error: Class '_WP_Editors' not found" yields 53,600 results, so I suspect that many other themes and plugins haven't transitioned to wp_editor() for the comment textarea yet.

The patch would keep backwards compatibility with the above technique.

comment:4 nacin21 months ago

  • Milestone changed from Awaiting Review to 3.4.2
  • Version changed from 3.4.1 to 3.4

comment:5 azaozz21 months ago

So the problem is that some plugins and themes have copied code from core instead of using the API and then didn't update/maintain that code when the corresponding WP functions were updated.

In this case it's easy to fix by putting these two lines back ticket:20119:2, but thinking we should not support this in general.

comment:6 azaozz21 months ago

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

In [21344]:

Bail out themes and plugins that have copied code from core and don't maintain it by requiring class-wp-editor.php in wp-langs.php, fixes #21350 for 3.4

comment:7 azaozz21 months ago

In [21345]:

Bail out themes and plugins that have copied code from core and don't maintain it by requiring class-wp-editor.php in wp-langs.php, fixes #21350 for trunk

Note: See TracTickets for help on using tickets.