#2617 Cache needs to be cleared when changing theme

v4.2.1
closed-fixed
Gerry Kroll
None
5
2009-09-27
2009-06-15
fade2gray
No

Problem: When changing theme, many image paths from the initial session theme are retained in the cache resulting in incorrect images being displayed.

Possible solution: Force the cache to be cleared when changing theme by adding a call to function "clearCache()" from within the function "print_theme_dropdown()".

Discussion

  • Gerry Kroll
    Gerry Kroll
    2009-06-16

    That's not going to work. The next visitor to the site is going to get the images from the theme you changed to, instead of the site default one.

    A better solution might be to include the theme name in the path to the cache file, so that the path would be "index/cache/theme/language/gedcom/block

     
  • Gerry Kroll
    Gerry Kroll
    2009-06-18

    • assigned_to: nobody --> canajun2eh
    • status: open --> pending-fixed
     
  • Gerry Kroll
    Gerry Kroll
    2009-06-18

    Fixed in SVN 5747. Replaced file "includes/index_cache.php".

    The index page caching system is now aware of the theme the page is being viewed in. There's a separate set of cache files for each theme. Each theme's cache files are created only as needed.

     
  • kiwi_pgv
    kiwi_pgv
    2009-06-19

    Gerry, not sure if this is coincidence, but after upgrading to svn 5749, I ran "Cleanup Index directory" from the Admin menu and got this error:

    Fatal error: Cannot redeclare full_rmdir() (previously declared in /xxxxxxxxx/xxxxxx/httpdocs/dir_editor.php:42) in /xxxxxxxxxxxxx/httpdocs/includes/index_cache.php on line 142

     
  • Gerry Kroll
    Gerry Kroll
    2009-06-19

    Thanks, Kiwi.

    I'll have to change the function name or have just a single instance of the function somewhere.

    Stay tuned.

     
  • Gerry Kroll
    Gerry Kroll
    2009-06-19

    Try SVN 5750.

    I took the quick-and-dirty route of re-naming the function.

    A more elegant solution would be to create a new "functions_file.php" and move all of the file and directory manipulation functions out of "functions.php" and the various other places in the program.

    This will have to wait for another day.

     
  • This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 100 days (the time period specified by
    the administrator of this Tracker).

     
    • status: pending-fixed --> closed-fixed