You are here: Foswiki>Tasks Web>Item13322 (26 Mar 2015, GeorgeClark)Edit Attach

Item13322: Code to refresh the language.cache no longer called by Configure

pencil
Priority: Urgent
Current State: Closed
Released In: 1.2.0
Target Release: minor
Applies To: Engine
Component: Configure
Branches: master
Reported By: GeorgeClark
Waiting For:
Last Change By: GeorgeClark
The LANGUAGE Checker has a routine refresh_cache, which removes the working/language.cache file. It used to be called in Types/LANGUAGE.pm sub onChange But that's no long implemented. The code got copied to the checker, but isn't used.

We need to clear the language cache, or changes to the enabled languages is a NOP.

-- GeorgeClark - 24 Mar 2015

There is a 2nd issue. The LANGUAGE checker can also generate compressed language files. This also should not be in the checker, but should be triggered only when the configuration is written.

I wonder if we need some hook during save to drive an onChange routine. Probably needed elsewhere I'd guess.

-- GeorgeClark - 24 Mar 2015

Hi Crawford, I'm making some headway with this.

  • Add a new option to the configuration spec: ONCHANGE="1" (for now)
  • Defined a static method to a Checker, that is used to perform last minute checks or actions during save. (But NEVER modify the config).
  • Extended LANGUAGE.pm checker. with onChange routine, to clear the language cache, (renamed refresh_cache stale code)
  • Extend Wizards/Save.pm if Spec->ONCHANGE, call Foswiki::Configure::Checkers::{CHECKER}::onChange

That will let us deal with the LANGUAGE cache, and language file compression code. I think another option is for {Password}, to do the hash of the admin password.

Not sure yet if ONCHANGE should allow something to be passed, or just a boolean. So marking this Being Worked On

-- GeorgeClark - 24 Mar 2015

 
Topic revision: r6 - 26 Mar 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy