WordPress.org

Make WordPress Core

#26750 closed defect (bug) (fixed)

Visual Tab does not react when clicked

Reported by: Ipstenu Owned by: azaozz
Milestone: 3.9 Priority: normal
Severity: critical Version: 3.9
Component: Editor Keywords:
Focuses: Cc:

Description

Source: http://wordpress.org/support/topic/unable-to-make-edit-posts

Visual tab is there, but if you click on it, nothing happens. JS Console when I click on the tab gives me this:

Uncaught TypeError: Cannot read property 'documentBaseURL' of undefined
Editor 
window.switchEditors.go 
window.switchEditors.switchto 
onclick

http://cl.ly/image/0N0a2F3Q161M

Change History (22)

comment:1 @Ipstenu14 months ago

  • Keywords needs-patch added
  • Severity changed from normal to critical

comment:2 @SergeyBiryukov14 months ago

  • Milestone changed from Awaiting Review to 3.9

comment:3 @azaozz14 months ago

A bit more info or a few more steps to reproduce would be nice, all seems to be working here :)

The editor doesn't initialize at all or only when switching Text -> Visual? Are you running latest trunk from /src? Did this start happening recently or when TinyMCE 4.0 was added 3 days ago?

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

comment:4 @ipstenu14 months ago

Running trunk, yes of course :)

It started happening yesterday after the 7pm update and only happens on some sites. Oddly I have two identical ones on the same network and it occurs on one but not the other. (On iOS it made my editor white out and I had to disable the visual editor entirely). So it looks like it's not initializing at all for iOS. I think it's not activitating TinyMCE since the OP (see the forum link) was getting oddly formatted HTML in his text editor.

I know the visual editor was working earlier because I had to switch to it in order to insert images, but now I'm 'stuck'.

Got the error on Chrome, iOS Safari, and I'll test more when I get to a grown up computer.

Last edited 14 months ago by ipstenu (previous) (diff)

comment:5 @Ipstenu14 months ago

All sorts of weird stuff is happening with the editor.

One site: I can switch to it, but my page it blank white (no content shows) and I can't get BACK. In the end, I made a new post, inserted media (nothing shows), saved, and THEN I could go back to text editor. If I go back to visual editor, the cycle starts again.

On another site, I can use it but icons are missing: http://cl.ly/image/0E333I0X2h1m

I managed to reproduce it on a clean site... With SEOSlides (of course I did the 'install the plugins that are different' method). o.O I would be surprised to find that's a plugin we have in common, but I have asked.

Not sure this is a broken plugin issue or a tinymce4 is a dingus issue or ... what. Will report upstream to SEOSlides too :)

comment:6 @azaozz14 months ago

Looking at the first screenshot (in the ticket), it seems the wp-admin/js/editor.js file hasn't been updated. That error is from trying to init TinyMCE the 3.x way.

Looking at the second screenshot, seems wp-includes/css/editor.css hasn't been updated. That's why TinyMCE uses only the default buttons styling (and of course our buttons don't have icons there).

Worst part is that the errors are inconsistent. Is it possible that all these errors are from stale browser cache? We are not refreshing $wp-version on each script or style change like bumpbot used to do. Perhaps would need to do that manually from time to time to make sure we bust the caches.

comment:7 @Ipstenu14 months ago

I can reliably reproduce the no-content/no-visualeditor if I use SEO Slides, but I tried the list of plugins from the forum OP and couldn't break it. So something's clearly kicking JS in the underpants.

The icons thing I flushed my caches the hard way (full form delete from browser AND server) and now it's okay. So yeah, caching. I have SCRIPT_DEBUG on, but that doesn't force the version. Maybe each 'nightly' should bump with the date? I mean, we're on trunk, we should know :)

comment:8 @ircbot14 months ago

This ticket was mentioned in IRC in #wordpress-dev by azaozz. View the logs.

comment:9 @azaozz14 months ago

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

In 26890:

TinyMCE: add stubs for the missing tinymce.util.Cookie, windowManager.onOpen and windowManager.onClose to the compat3x plugin. See #24067, fixes #26750.

comment:10 @Ipstenu14 months ago

For posterity and confirmation: This solved my problem with SEOSlides. And then it broke again the next morning. Yaaay.

Last edited 14 months ago by Ipstenu (previous) (diff)

comment:11 @ericmann14 months ago

Out of curiosity, is there documentation anywhere for how plugin devs can update their code to work with the newer APIs? (i.e. Not depend on method stubs in core but to actually do things the right way?)

comment:12 @azaozz14 months ago

If the plugin dev has created TinyMCE plugin, I'd think they know how to update it for 4.0: http://www.tinymce.com/wiki.php/api4:index and http://www.tinymce.com/wiki.php/Tutorial:Migration_guide_from_3.x.

If the plugin dev is including a TinyMCE plugin in their WordPress plugin, they'll need to include the updated version.

If the plugin dev is just adding a button to the toolbar, that works pretty much the same. It is advisable to update it to use dashicons.

comment:13 @glenlipka14 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This is still broken for me. Just updated to the nightly.

comment:14 @Ipstenu14 months ago

Yeah, it's broken again.

comment:15 @glenlipka14 months ago

Error I got:
TypeError: tinymce.util.Cookie is undefined
var ignore = tinymce.util.Cookie.getHash('atd_ignore');

/wp-content/plugins/jetpack/modules/after-the-deadline/tinymce/editor_plugin.js?v=20120221

comment:16 @ircbot14 months ago

This ticket was mentioned in IRC in #wordpress-dev by nacin. View the logs.

comment:17 @azaozz14 months ago

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

In 26930:

TinyMCE: update compat3x.min.js and bump $tinymce_version. See #24067, fixes #26750.

comment:18 follow-up: @azaozz14 months ago

It was my fault, sorry. The new build process is so nice, forgot to pre-minify the compat3x plugin after adding more stuff in it :)

comment:19 in reply to: ↑ 18 ; follow-up: @glenlipka14 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to azaozz:

It was my fault, sorry. The new build process is so nice, forgot to pre-minify the compat3x plugin after adding more stuff in it :)

I just updated again. Still broken. (latest firefox and chrome on Windows 8.1) - Same JS error. I emptied my cache.

comment:20 in reply to: ↑ 19 @azaozz14 months ago

Replying to glenlipka:

The changes from yesterday night weren't in the latest nightly. Just pushed new nightly, should be fixed now.

comment:21 @glenlipka14 months ago

Looks fixed! :)

Thanks much.

comment:22 @ocean9014 months ago

  • Keywords needs-patch removed
  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.