Pages: 1
Hi,
as $subj says, I can't use piwigo with the mobile devices (either iOS or Android). I'm left with the error:
[php:error] [pid 64561] [client xxx:55361] PHP Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:/pw/themes/smartpocket/template/footer.tpl" on line 20 "document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={isset($COOKIE_PATH) ? $COOKIE_PATH : ''}';" - Unexpected " ? ", expected one of: "}" <-- \n thrown in /pw/include/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 20, referer: xxxx
I see this error on freshly installed 13.0 or even on upgraded 13.1 version.
System is FreeBSD 12.3/13.1 with the
php80-8.0.24
mysql80-server-8.0.30
I've googled around with the similar messages but neither solutions works (clearing the cache, etc.). Also seems to be a problem in the template itself.
Any suggestions?
thanks.
Offline
Hello,
SmartPocket is somewhat obsolete and I was told it was not meant to be updated.
I uninstalled it completely and keeps only Bootstrap Darkroom for both desktop and mobile browsing.
I tested this with Piwigo 13.1 and php 8.0.24.
Offline
While I'd rather stick to the default theme on PC this bootstrap darkroom is not that bad (I guess I hate changes:) ). While it's not a solution it's definitely nice workaround.
Thanks Katryne.
Offline
Indeed SmartPocket appears broken, on Android (Firefox, Fennec and Browser) it displays only albums for me, but no content; works in desktop browser. However, I got the same error message in the PHP log. Now deinstalled SmartPocket.
Piwigo Android from F-Droid, even if old, works so far (haven't tried adding content).
https://f-droid.org/en/packages/org.piwigo.android/
Probably same from GPlay.
I now use Bootstrap Darkroom as mobile theme only (note this is not necessary if you use it as default theme anyway), by having patched its themes/bootstrap_darkroom/themeconf.inc.php to insert the 'mobile' => true property
--- themes/bootstrap_darkroom/themeconf.inc.php.orig 2022-09-21 15:19:52.000000000 +0200 +++ themes/bootstrap_darkroom/themeconf.inc.php 2022-10-23 13:09:01.777985525 +0200 @@ -11,6 +11,7 @@ require_once(PHPWG_THEMES_PATH . 'bootst require_once(PHPWG_THEMES_PATH . 'bootstrap_darkroom/include/config.php'); $themeconf = array( + 'mobile' => true, 'name' => 'bootstrap_darkroom', 'parent' => 'default', 'load_parent_css' => false,
and after that deactivate/activate the theme again to have it registered in table piwigo_config as mobile_theme bootstrap_darkroom.
Offline
I like SmartPocket on mobile device, so for now I simply put back smartpocket/template/footer.tpl from 13.0.0. And hopefully the next update will fix it more properly.
The only change is after this line
{footer_script require='jquery'}
The previous version contained:
document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={$COOKIE_PATH}';
So you can simply replace the new version with this one. I know the change was made for some reason, but for me this is better than nothing, for now.
Last edited by MiPi (2022-10-23 15:38:33)
Offline
So the update changed code from
+';path={$COOKIE_PATH}';
to
+';path={isset($COOKIE_PATH) ? $COOKIE_PATH : ''}';
that obviously is wrong for the levels of single quotes forming string literals to assemble.
That might have to be instead
+';path='{isset($COOKIE_PATH) ? $COOKIE_PATH : ''};
placing the actual $COOKIE_PATH if set as value, if a path= value without any quotes can actually be handled by document.cookie.
The tempting "escape the quotes" like
+';path={isset($COOKIE_PATH) ? $COOKIE_PATH : \'\'}';
IMHO doesn't make sense as that would have to evaluate the entire {} braced expression within the literal.
Let the Piwigo devs decide..
There's [Github] Piwigo issue #1766 for this.
Offline
Fwiw, the changes of commit [Github] piwigo-smartpocket commit 738dcde3 fix the problem for me.
You can apply the patch on the command line with
cd YourPiwigoDirectory/themes/smartpocket curl https://github.com/Piwigo/piwigo-smartpocket/commit/738dcde354d73fad6b08442dcebdc9b5e8fbc002.patch | patch -p1
Edit: I erroneously stated patch -p0, corrected to patch -p1
Sorry for the inconvenience..
Last edited by erAck (2022-10-31 14:57:05)
Offline
Pages: 1