Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#32293 closed defect (bug) (invalid)

Visual Editor Javascript Bugs

Reported by: ianatkins's profile ianatkins Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2.2
Component: TinyMCE Keywords:
Focuses: javascript Cc:

Description

On toggling between the Visual and Text editor I see the following JavaScript error in the console.
Uncaught TypeError: wp.mce.views.toViews is not a function

With SCRIPT_DEBUG enabled, or CONCATENATE_SCRIPTS disabled in wp-config.php, switching between editor modes works, but using the Add Edit link functionality results in:
Uncaught TypeError: Cannot read property 'select' of undefined
wplink.js?ver=4.2.2:142

If I tag the post ‘London’, the tag is then shown as “Lundefinedoundefinednundefineddundefinedoundefinednundefined....” - placing undefined after each letter.

/

I have duplicated the site locally but can't replicate on a clean install. Have cleared browser cache, cookies, reinstalled Wordpress.

Change History (6)

#1 @azaozz
10 years ago

Hmm, something doesn't add up. Can't see anything that would cause this error in wplink.js on line 142: https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-includes/js/wplink.js#L140.

Perhaps the upgrade didn't go through properly or the old file is still being cached in a network cache somewhere? Can you try opening that file directly in the browser, then hold down Ctrl/Shift to refresh from the server and reload it couple of times. If it doesn't change, perhaps compare it to the same file in the zip package.

#2 @ianatkins
10 years ago

@azaozz thanks. The file on the live site is out of sync.

The Refresh functions looks like the following:

		refresh: function() {
			// Refresh rivers (clear links, check visibility)
			rivers.search.refresh();
			rivers.recent.refresh();

			if ( wpLink.isMCE() ) {
				wpLink.mceRefresh();
			} else {
				wpLink.setDefaultValues();
			}

			if ( isTouch ) {
				// Close the onscreen keyboard
				inputs.url.focus().blur();
			} else {
				// Focus the URL field and highlight its contents.
				// If this is moved above the selection changes,
				// IE will show a flashing cursor over the dialog.
				inputs.url.focus()[0].select();
			}

			// Load the most recent results if this is the first time opening the panel.
			if ( ! rivers.recent.ul.children().length ) {
				rivers.recent.ajax();
			}
		},

The site auto updated, I did have the wp-content and wp-includes folder hardened with .htaccess files, do you think that could of blocked the file updates, but still bumped the Wordpress version?

#3 @DrewAPicture
10 years ago

@ianatkins: You might try reinstalling WordPress from the updates screen to see if that will bring it back in sync.

#4 @azaozz
10 years ago

...blocked the file updates, but still bumped the Wordpress version?

Don't think so as $wp_version is stored in wp-includes/version.php, and that was updated. On the other hand, there may have been file permissions differences between the files preventing update of some files?

It would also be good to confirm if your .htaccess files were affecting the auto-update.

Last edited 10 years ago by azaozz (previous) (diff)

#5 @ianatkins
10 years ago

  • Keywords close added
  • Resolution set to invalid
  • Status changed from new to closed

After re-uploading Wordpress, turned out it was an issue with the hosting setup and nginx caching the Javascript files.
As for why the cache wasn't cleared, with the version bump in the url, I'm not sure.

I've closed the ticket, thanks for the pointers @azaozz

#6 @DrewAPicture
10 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.