Pages: 1
Hello
I just completed an installation of Piwigo 14 rc2 on Ubuntu 23.10.
Setup went well. I tested a first synchronization with a small folder just to test. Everything went fine.
Then I tried with my main photo repository (with thousands of pictures). It went well except complaining about some ".stfolder". I visited the gallery and everything looked good. Went back to admin then got the following error,
Fatal error: Uncaught DivisionByZeroError: Division by zero in /var/www/html/piwigo/_data/templates_c/p6jhns^04df1cc8f79a0cbb43aa86e156c6c59f144a4856_0.file.intro.tpl.php:504 Stack trace: #0 /var/www/html/piwigo/include/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_657628a9117f89_93793372() #1 /var/www/html/piwigo/include/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode() #2 /var/www/html/piwigo/include/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render() #3 /var/www/html/piwigo/include/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render() #4 /var/www/html/piwigo/include/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute() #5 /var/www/html/piwigo/include/template.class.php(481): Smarty_Internal_TemplateBase->fetch() #6 /var/www/html/piwigo/include/template.class.php(404): Template->parse() #7 /var/www/html/piwigo/admin/intro.php(497): Template->assign_var_from_handle() #8 /var/www/html/piwigo/admin.php(346): include('...') #9 {main} thrown in /var/www/html/piwigo/_data/templates_c/p6jhns^04df1cc8f79a0cbb43aa86e156c6c59f144a4856_0.file.intro.tpl.php on line 504
Any ideas on how to solve this? I suspect it might be the "hidden" .stfolder (I'm using synching to synchronize my photos folder with another machine).
Thanks.
Offline
Look at file
/var/www/html/piwigo/_data/templates_c/p6jhns^04df1cc8f79a0cbb43aa86e156c6c59f144a4856_0.file.intro.tpl.php
the 3rd line tells from what source file it was generated. Note it down, it might be a plugin.
Delete the p6jhns^04df1cc8f79a0cbb43aa86e156c6c59f144a4856_0.file.intro.tpl.php file and see if the error persists; if yes and the generating source file is a plugin, move that plugin/name folder to somewhere else outside your web server's document folder so it isn't executed anymore and delete the newly generated *.file.intro.tpl.php
Offline
The source file is,
/var/www/html/piwigo/admin/themes/default/template/intro.tpl
So it appears to be part of the base package and not a plugin?
I deleted it and tried accessing the admin page. Same error.
So I checked the line where the error occurs and it's the following,
" style="width:<?php echo $_smarty_tpl->tpl_vars['details']->value['total']['filesize']/$_smarty_tpl->tpl_vars['STORAGE_TOTAL']->value*100;?>
From the error one can conclude that $_smarty_tpl->tpl_vars['STORAGE_TOTAL']->value has value 0. Now it's not clear why that would be.
Offline
No, the admin default theme is not a plugin..
Having a total storage size of 0 doesn't make sense indeed, unless no storage calculation files are present at all or all their file sizes were calculated as 0.
You could try to load the admin.php?page=maintenance page in your browser and recalculate/refresh the cache size (under Purge Cache), if $conf['add_cache_to_storage_chart'] is not set to false that size should be added to the total storage.
If that doesn't work you could edit admin/intro.php and on line 483 change
$total_storage = 0;
to
$total_storage = 1;
before the individual $value['total']['filesize'] are summed up. My guess is those are broken, but at least the /0 error wouldn't occur and proceeding with the dashboard page could work.
Offline
Doing a purge cache (and even a refresh) solved the problem. Admin is back!
Thanks a lot!
Offline
Pages: 1