Always detect changes in template file

Created on 7 December 2023, 11 months ago
Updated 22 January 2024, 10 months ago

Problem/Motivation

Sometimes, I update the template file to another file with different content, but it doesn't get picked up. I need to temporarily rename the file to something else, reload the create node page, see that the CKEditor is collapsed due to missing template file, rename the file back to the original, reload, and now the changes are loaded.

This happens in Firefox.

Proposed resolution

Maybe reload the template file always, when the CKEditor is opened, for creating or editing a node?

Workaround:

  1. Update the content in the template file
  2. Rename it, for example by adding -v2 to this: ckeditor5_template-v2.json
  3. Update the "Template file location" path under text filter to match

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

πŸ‡©πŸ‡°Denmark ressa Copenhagen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ressa
  • Status changed to Closed: works as designed 11 months ago
  • πŸ‡©πŸ‡ͺGermany vincent.hoehn Dresden, Germany

    Hi @ressa, I can't reproduce this.
    Each time the CKEditor is loaded, the stored configuration is loaded, in this case the "file_path". The file is then loaded.
    If there are problems with the wrong content of the file or the wrong file itself, there can only be cache problems.
    Normally, the changes should be applied after deleting the cache.

  • Status changed to Active 11 months ago
  • πŸ‡©πŸ‡ͺGermany e.r.n.i.e

    I can confirm this problem. I had to save the template.json file under a different filename (template_new.json) to make my changes to be picked up. Clearing the cache (drush -cr) did not help.

    But now when I add another change to the new file - it works as expected! Even without clearing the cache.

    But when I select the file with the old filename again, I still get the old content of the file although the content of both files is identical!

    Very strange.

  • πŸ‡©πŸ‡°Denmark ressa Copenhagen
  • πŸ‡©πŸ‡°Denmark ressa Copenhagen
  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    Thanks @e.r.n.i.e, renaming the file, seems to be the method to get around this, for now ... I am also using Firefox, so maybe a clue?

    I added the method in the Issue Summary, as a workaround. But it's not ideal, so it would be great to get this fixed, and always grab a fresh copy of the template file, and not an old, cached version.

  • Status changed to Closed: cannot reproduce 10 months ago
  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    Well, this is a bit strange, but it seems like simply pressing F5 refreshes the template file, and gets the latest version after an edit ... I am pretty sure I have tried this, as well as Ctrl+F5 before ... Odd :)

    But since I can't reproduce, and everything works fine, I'll close the issue.

  • πŸ‡ΊπŸ‡ΈUnited States rex.barkdoll

    I'm adding to this for anyone else who runs into this problem. I was also experiencing a caching issue where my template changes would not update. It seems to be the fault of the browser's cache, not the website's cache. A forced refresh (CTRL+Shift+R) a few times finally cleared Chrome's browser cache enough to see the changes.

    Seems like renaming the template file may also be an alternative solution - or just clearing your browser cache, but that sucks because you lose your login status.

    Anyhoo, hope this helps.

Production build 0.71.5 2024