Opened 10 years ago
Closed 10 years ago
#33393 closed defect (bug) (fixed)
tinymce plugin wplink throw js TypeError: editor.wp undefined
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.3.1 | Priority: | normal |
Severity: | normal | Version: | 4.3 |
Component: | TinyMCE | Keywords: | has-patch fixed-major |
Focuses: | Cc: |
Description
When TinyMCE initialize with plugin wplink enable but not wordpress, the wplink js throw TypeError: editor.wp undefined
To reproduce, initialize a new TinyMCE editor with wplink plugins enable.
tinyMCE.init({ plugins: "wplink" }); tinyMCE.execCommand( 'mceAddEditor', true, "textarea" )
To fix, the js should check for wp object exist before calling the function:
editor.on( 'preinit', function() { // editor may not have wp object if tinymce wordpress plugin isn't loaded. if ( editor.wp && editor.wp._createToolbar ) { toolbar = editor.wp._createToolbar( [ 'wp_link_preview', 'wp_link_edit', 'wp_link_remove' ], true ); } } );
The patch file is attached.
Attachments (1)
Change History (12)
#1
follow-up:
↓ 2
@
10 years ago
- Keywords reporter-feedback added
- Version changed from trunk to 3.3
Does wplink work without the wordpress plugin?
This ticket was mentioned in Slack in #core by lumberhack. View the logs.
10 years ago
#6
@
10 years ago
- Owner set to azaozz
- Resolution set to fixed
- Status changed from new to closed
In 33728:
#7
follow-up:
↓ 8
@
10 years ago
- Milestone changed from Awaiting Review to 4.3.1
- Resolution fixed deleted
- Status changed from closed to reopened
Reopen for 4.3 consideration.
#9
in reply to:
↑ 8
@
10 years ago
- Keywords has-patch added; reporter-feedback removed
Replying to LumberHack:
Disabling the wordpress
plugin when using the other custom plugins for TinyMCE is a rare edge case that was fixed in trunk. It affects 4.3 so moved it to the 4.3.1 milestone for consideration.
Note: See
TracTickets for help on using
tickets.
fix exception TypeError: editor.wp undefined