Opened 6 years ago

Closed 5 years ago

#10335 closed Bug (duplicate)

Overwriting CKEditor with a different preset leads to a JavaScript error due to browser cache

Reported by: Wiktor Walc Owned by:
Priority: Normal Milestone:
Component: General Version: 4.0
Keywords: Cc:

Description

It looks like there is a common scenario that is somewhat troublesome for users:

  1. User downloads standard preset
  2. User sees that the text color button is missing, so he downloads another preset OR std preset + colorbutton
  3. The previous std preset is overwritten in the same location
  4. User launches the attached samples and sees no changes, so he hits F5 and the browser loads the new ckeditor.js ("Did you clear the cache? - Yes!")
  5. ...aaand now the funny thing happens: the new ckeditor.js does not load the new language file, because the timestamp (used to solve caching issues) is still the same! This is because ckeditor.js has been created from the same version of core.

The result is that the first thing that requires new language entries throws a JavaScript error.

After downloading the full preset I got:

Uncaught TypeError: Cannot read property 'ltr' of undefined

After downloading the standard preset + colorbutton I got:

Uncaught TypeError: Cannot read property 'textColorTitle' of undefined

Sample reports that have not been identified properly:

plus possibly a mysterious issues like this one:

Proposed solution:

Stop using timestamp when requesting external resources. Start using a hash that is constructed using the same set of things that we use to cache packages generated with online builder:

  • core version
  • selected plugins along with their versions
  • selected skins along with their versions
  • selected languages

1) The hash could be calculated in CKEditor itself. But CKEditor has no idea about version numbers of included plugins plus it would add a bit of useless code to the package.

2) The hash could be generated by CKBuilder and added to ckeditor.js when generating the package (CKEDITOR.hash='xyz';). All builds created online should be 100% safe this way.

The command line version of CKBuilder would not be able to use version numbers of plugins just like CKEditor, but still creating a different hash whenever a plugin is added to the preset would dramatically reduce the number of this kind of issues.

Change History (3)

comment:1 Changed 6 years ago by Wiktor Walc

Status: newconfirmed

comment:2 Changed 6 years ago by Jakub Ś

sees no changes, so he hits F5 and the browser loads the new ckeditor.js ("Did you clear the cache? - Yes!")

I agree CKE should be as user-friendly as possible.

I have however one but. Pressing F5 or even Ctrl+F5 is not the way to clear cache in IE. Closing the page (or opening other page) and using top menu http://kb.wisc.edu/page.php?id=15141 is the way to do it:)

comment:3 Changed 5 years ago by Wiktor Walc

Resolution: duplicate
Status: confirmedclosed

Duplicate of #11625

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy