From 639fd82199fb4f5e07d823157e847455ae05f9af Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 17 Feb 2014 14:28:05 +0000 Subject: [PATCH] force re-import of etemplates if app-version changes --- etemplate/inc/class.boetemplate.inc.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etemplate/inc/class.boetemplate.inc.php b/etemplate/inc/class.boetemplate.inc.php index 40ac5f009d..542ca3c33d 100644 --- a/etemplate/inc/class.boetemplate.inc.php +++ b/etemplate/inc/class.boetemplate.inc.php @@ -969,12 +969,15 @@ class boetemplate extends soetemplate if (($time = @filemtime($path))) { $templ = new boetemplate(array('name' => '.'.$app,'lang' => '##')); - if ($templ->lang != '##' || $templ->modified < $time) // need to import + if ($templ->lang != '##' || $templ->version != $GLOBALS['egw_info']['apps'][$app]['version'] || + $templ->modified < $time) // need to import { + $templ->delete(); // delete old timestamp //echo "

".__METHOD__."($app) import necessary, as app-modified=$templ->modified < filemtime($path)=$time test-tpl=".array2string($templ->as_array(1))."

\n"; $ret = self::import_dump($app); $templ->modified = $time; - $templ->save('.'.$app,'','##'); + // store new timestamp incl. app version + $templ->save('.'.$app,'','##',0,$GLOBALS['egw_info']['apps'][$app]['version']); } } return $ret;