diff --git a/admin/include/updates.class.php b/admin/include/updates.class.php index 9b837e90b..934fde731 100644 --- a/admin/include/updates.class.php +++ b/admin/include/updates.class.php @@ -545,9 +545,14 @@ class updates self::process_obsolete_list($obsolete_list); deltree(PHPWG_ROOT_PATH.$conf['data_location'].'update'); invalidate_user_cache(true); - $template->delete_compiled_templates(); if ($step == 2) { + // only delete compiled templates on minor update. Doing this on + // a major update might even encounter fatal error if Smarty + // changes. Anyway, a compiled template purge will be performed + // by upgrade.php + $template->delete_compiled_templates(); + $page['infos'][] = l10n('Update Complete'); $page['infos'][] = $upgrade_to; $step = -1; diff --git a/include/smarty/libs/sysplugins/smarty_internal_undefined.php b/include/smarty/libs/sysplugins/smarty_internal_undefined.php index 7df0acc2d..635b4818b 100644 --- a/include/smarty/libs/sysplugins/smarty_internal_undefined.php +++ b/include/smarty/libs/sysplugins/smarty_internal_undefined.php @@ -61,6 +61,15 @@ class Smarty_Internal_Undefined if (isset($this->class)) { throw new SmartyException("undefined extension class '{$this->class}'"); } else { + // Piwigo specifics - starts here + // when updating from Piwigo 11 to 12, we try to delete compiled templates and there is a mix old and new Smarty files, resulting in a: + // Fatal error: Uncaught --> Smarty: Smarty->_clearTemplateCache() undefined method + // indeed this method does not exist in Smarty 3.1.29 (Piwigo 11) but exists in Smarty 3.1.39 (Piwigo 12) + if ('_clearTemplateCache' == $name) + { + return; + } + // Piwigo specifics - stops here throw new SmartyException(get_class($args[ 0 ]) . "->{$name}() undefined method"); } }