i updated to 13.1.0 recently, but the photo view inside an album is not working anymore. Thrown error in GUI:
Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:/var/www/vhosts/xxxx/xxxx/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: "}" <-- thrown in /var/www/vhosts/xxxx/xxxxx/include/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 20
Standard view works fine. Albums are still listed on mobile, but when opening an album, no photos are shown and the error is listed at the bottom of the page
Hello,
i updated to 13.1.0 recently, but the photo view inside an album is not working anymore. Thrown error in GUI:
`
Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:/var/www/vhosts/xxxx/xxxx/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: "}" <-- thrown in /var/www/vhosts/xxxx/xxxxx/include/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 20
`
Standard view works fine. Albums are still listed on mobile, but when opening an album, no photos are shown and the error is listed at the bottom of the page
<!-- github-sync-id:1419717485 -->
I checked the footer template in
themes/smartpocket/template/footer.tpl
I changed the line 20 from: document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={isset($COOKIE_PATH) ? $COOKIE_PATH : ''}';
to document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={$COOKIE_PATH}';
I checked the footer template in
themes/smartpocket/template/footer.tpl
I changed the line 20 from:
`document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={isset($COOKIE_PATH) ? $COOKIE_PATH : ''}';`
to
`document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={$COOKIE_PATH}';`
So I reverted this commit https://github.com/Piwigo/piwigo-smartpocket/commit/1e948e4a12ad1c01dcf4292bd1f0b8cb299f9f81 . The template error is gone and all photos are showing properly.
Unfortunately I dont know how the syntax should be in a corrected way, so I cannot fix it and commit :-(...
<!-- github-comment-id:1288151049 -->
I tried this syntax: document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={$COOKIE_PATH|default:''}';
Not sure if correct, if confirmed to be working for others, this would be a solution...
I tried this syntax:
`document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={$COOKIE_PATH|default:''}';`
Not sure if correct, if confirmed to be working for others, this would be a solution...
<!-- github-comment-id:1288154812 -->
This part +';path={isset($COOKIE_PATH) ? $COOKIE_PATH : ''}';
of course is wrong for the levels of single quotes forming string literals to assemble.
I'd guess it should instead be
This part
`+';path={isset($COOKIE_PATH) ? $COOKIE_PATH : ''}';`
of course is wrong for the levels of single quotes forming string literals to assemble.
I'd guess it should instead be
```
+';path='{isset($COOKIE_PATH) ? $COOKIE_PATH : ''};
```
See also https://piwigo.org/forum/viewtopic.php?id=32263
<!-- github-comment-id:1288206027 -->
Tested my patch (https://github.com/Piwigo/Piwigo/issues/1766#issuecomment-1288154812) also on PHP 8 - works so far. I created a PR
https://github.com/Piwigo/piwigo-smartpocket/pull/8
<!-- github-comment-id:1290089377 -->
Sure, try the patch of the pull request mentioned and give feedback whether it works for you. Or try the change of my previous comment. One of them should work. Or replace that line with the old code as mentioned above in https://github.com/Piwigo/Piwigo/issues/1766#issuecomment-1288151049 .
Sure, try the patch of the pull request mentioned and give feedback whether it works for you. Or try the change of my previous comment. One of them should work. Or replace that line with the old code as mentioned above in https://github.com/Piwigo/Piwigo/issues/1766#issuecomment-1288151049 .
<!-- github-comment-id:1295762082 -->
> `+';path={$COOKIE_PATH|default:''}';`
I'm not convinced of that approach, see my comment at the patch https://github.com/Piwigo/piwigo-smartpocket/pull/8#discussion_r1008836712 .
<!-- github-comment-id:1296225870 -->
@erAck @bigcookie have you tested the commit pushed by @MatthieuLP ? https://github.com/Piwigo/piwigo-smartpocket/commit/738dcde354d73fad6b08442dcebdc9b5e8fbc002
<!-- github-comment-id:1296252315 -->
@plegall the patch from @MatthieuLP works for me.
I agree, that I didnt understand to replace a missing string with an empty one. I just tried to fix the syntax error. The new patch looks better to me.
I will cancel my PR.
@plegall the patch from @MatthieuLP works for me.
I agree, that I didnt understand to replace a missing string with an empty one. I just tried to fix the syntax error. The new patch looks better to me.
I will cancel my PR.
<!-- github-comment-id:1296362828 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Hello,
i updated to 13.1.0 recently, but the photo view inside an album is not working anymore. Thrown error in GUI:
Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:/var/www/vhosts/xxxx/xxxx/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: "}" <-- thrown in /var/www/vhosts/xxxx/xxxxx/include/smarty/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 20Standard view works fine. Albums are still listed on mobile, but when opening an album, no photos are shown and the error is listed at the bottom of the page
I checked the footer template in
themes/smartpocket/template/footer.tpl
I changed the line 20 from:
document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={isset($COOKIE_PATH) ? $COOKIE_PATH : ''}';to
document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={$COOKIE_PATH}';So I reverted this commit https://github.com/Piwigo/piwigo-smartpocket/commit/1e948e4a12ad1c01dcf4292bd1f0b8cb299f9f81 . The template error is gone and all photos are showing properly.
Unfortunately I dont know how the syntax should be in a corrected way, so I cannot fix it and commit :-(...
I tried this syntax:
document.cookie = 'screen_size='+jQuery(document).width()+'x'+jQuery(document).height()+';path={$COOKIE_PATH|default:''}';Not sure if correct, if confirmed to be working for others, this would be a solution...
This part
+';path={isset($COOKIE_PATH) ? $COOKIE_PATH : ''}';of course is wrong for the levels of single quotes forming string literals to assemble.
I'd guess it should instead be
See also https://piwigo.org/forum/viewtopic.php?id=32263
Tested my patch (https://github.com/Piwigo/Piwigo/issues/1766#issuecomment-1288154812) also on PHP 8 - works so far. I created a PR
https://github.com/Piwigo/piwigo-smartpocket/pull/8
Any work around in the meantime?
Sure, try the patch of the pull request mentioned and give feedback whether it works for you. Or try the change of my previous comment. One of them should work. Or replace that line with the old code as mentioned above in https://github.com/Piwigo/Piwigo/issues/1766#issuecomment-1288151049 .
The patch of the pull request works for me and my PHP 7.4.32.
I'm not convinced of that approach, see my comment at the patch https://github.com/Piwigo/piwigo-smartpocket/pull/8#discussion_r1008836712 .
@erAck @bigcookie have you tested the commit pushed by @MatthieuLP ? https://github.com/Piwigo/piwigo-smartpocket/commit/738dcde354d73fad6b08442dcebdc9b5e8fbc002
@plegall @MatthieuLP yes that works, thanks!
I don't have a phone with this problem but my friend says the site is now working for her.
@plegall the patch from @MatthieuLP works for me.
I agree, that I didnt understand to replace a missing string with an empty one. I just tried to fix the syntax error. The new patch looks better to me.
I will cancel my PR.