Make WordPress Core

Opened 8 months ago

Closed 5 months ago

#63308 closed defect (bug) (fixed)

tinymce cache key should be updated

Reported by: oferlaor's profile oferlaor Owned by: audrasjb's profile audrasjb
Milestone: 6.8.2 Priority: normal
Severity: normal Version: 6.8
Component: TinyMCE Keywords: has-patch fixed-major
Focuses: Cc:

Description (last modified by sabernhardt)

when I paste a youtube link into wordpress classic editor, I get this error:

tinymce.min.js?ver=49110-20201110:2 Uncaught IndexSizeError: Failed to execute ‘setStart’ on ‘Range’: There is no child at offset 12.
at Kh (tinymce.min.js?ver=49110-20201110:2:218016)
at tN. (tinymce.min.js?ver=49110-20201110:2:410)
at c.fire (tinymce.min.js?ver=49110-20201110:2:197006)
at tN.fire (tinymce.min.js?ver=49110-20201110:2:197532)
at ev.nodeChanged (tinymce.min.js?ver=49110-20201110:2:220592)
at tN.nodeChanged (tinymce.min.js?ver=49110-20201110:2:345084)
at tN. (tinymce.min.js?ver=49110-20201110:2:220079)
at c.fire (tinymce.min.js?ver=49110-20201110:2:197006)
at tN.fire (tinymce.min.js?ver=49110-20201110:2:197532)
at Pp (tinymce.min.js?ver=49110-20201110:2:199169)

So, I tried to compare what I had with 6.7.2, turns out the issue is that there are small changes to TinyMCE (not sure since when) but the cache key (wp-includes/version.php) has not been updated for a while.

$tinymce_version = '49110-20201110';

For sites that have no cloudflare/similar cache, it might not make a difference, but those that might get an incorrect tinymce version and some errors...

Change History (10)

#1 follow-up: @sabernhardt
5 months ago

  • Component changed from Editor to TinyMCE
  • Description modified (diff)

Hi and welcome!

[60007] edited TinyMCE-related files, but I did not find an update to tinymce.min.js (or tinymce.js).
https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/vendor/tinymce

#2 in reply to: ↑ 1 @siliconforks
5 months ago

Replying to sabernhardt:

[60007] edited TinyMCE-related files, but I did not find an update to tinymce.min.js (or tinymce.js).

It seems like that version (49110-20201110) is being used for a lot of other URLs besides just tinymce.min.js though.

For example, when I try using the classic editor with SCRIPT_DEBUG set to true, it requests the URL wp-includes/js/tinymce/plugins/wordpress/plugin.js?wp-mce-49110-20201110 (but that is one of the files modified in [60007]).

#3 @sabernhardt
5 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 6.8.2
  • Version set to 6.8

This ticket was mentioned in PR #9162 on WordPress/wordpress-develop by @sukhendu2002.


5 months ago
#4

  • Keywords has-patch added; needs-patch removed

#5 @audrasjb
5 months ago

  • Owner set to audrasjb
  • Status changed from new to reviewing

Hello and thanks for the ticket,
@oferlaor are you able to confirm the issue is fixed when you try to manually update the cache key on your side?

#6 @oferlaor
5 months ago

Yep. That’s how I fixed it

#7 @audrasjb
5 months ago

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

In 60413:

TinyMCE: Update TinyMCE cache version to prevent script errors.

Changeset [60007] updated some TinyMCE-related files but did not update the $tinymce_version cache key located in wp-includes/version.php. This changeset updates the cache key with the date of the last changes.

Follow-up to [60007].

Props oferlaor, sabernhardt, siliconforks, audrasjb.
Fixes #63308.

#8 @audrasjb
5 months ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 6.8 branch backport.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


5 months ago

#10 @audrasjb
5 months ago

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

In 60436:

TinyMCE: Update TinyMCE cache version to prevent script errors.

Changeset [60007] updated some TinyMCE-related files but did not update the $tinymce_version cache key located in wp-includes/version.php. This changeset updates the cache key with the date of the last changes.

Follow-up to [60007].

Merges [60413] to the 6.8 branch.
Props oferlaor, sabernhardt, siliconforks, audrasjb.
Fixes #63308.

Note: See TracTickets for help on using tickets.