Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#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:


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


Change History (22)

#1 @Ipstenu
8 years ago

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

#2 @SergeyBiryukov
8 years ago

  • Milestone changed from Awaiting Review to 3.9

#3 @azaozz
8 years 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 8 years ago by azaozz (previous) (diff)

#4 @ipstenu
8 years 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 8 years ago by ipstenu (previous) (diff)

#5 @Ipstenu
8 years 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 :)

#6 @azaozz
8 years 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.

#7 @Ipstenu
8 years 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 :)

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

8 years ago

#9 @azaozz
8 years 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.

#10 @Ipstenu
8 years ago

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

Last edited 8 years ago by Ipstenu (previous) (diff)

#11 @ericmann
8 years 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?)

#12 @azaozz
8 years 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.

#13 @glenlipka
8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

#14 @Ipstenu
8 years ago

Yeah, it's broken again.

#15 @glenlipka
8 years ago

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


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

8 years ago

#17 @azaozz
8 years 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.

#18 follow-up: @azaozz
8 years 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 :)

#19 in reply to: ↑ 18 ; follow-up: @glenlipka
8 years 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.

#20 in reply to: ↑ 19 @azaozz
8 years ago

Replying to glenlipka:

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

#21 @glenlipka
8 years ago

Looks fixed! :)

Thanks much.

#22 @ocean90
8 years ago

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