Opened 10 months ago

Closed 10 months ago

Last modified 10 months ago

#21350 closed defect (bug) (fixed)

Fatal error: Class '_WP_Editors' not found

Reported by: needle Owned by: azaozz
Priority: normal Milestone: 3.4.2
Component: TinyMCE Version: 3.4
Severity: normal Keywords: has-patch
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 10 months ago.

Download all attachments as: .zip

Change History (8)

  • 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 10 months ago by azaozz (previous) (diff)
  • 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.

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

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.

  • 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

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.