mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
fixes #1545 avoid fatal error during upgrade from 11 to 12
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user