Hi,
On creating an album, adding some photos, adding users and a group and then for this album restricting access to the group, I get the following error, which returns every time I open the album's rights tab:
Fatal error: Uncaught ValueError: Unknown format specifier "j" in /path/to/photos/include/functions.inc.php:1260 Stack trace: #0 /path/to/photos/include/functions.inc.php(1260): vsprintf() #1 /path/to/photos/_data/templates_c/p6jhns^aa8e148beddff706df9082a8a22bbd0640899831_0.file.cat_perm.tpl.php(158): l10n() #2 /path/to/photos/include/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_65dca1799e28b4_72524937() #3 /path/to/photos/include/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode() #4 /path/to/photos/include/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render() #5 /path/to/photos/include/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render() #6 /path/to/photos/include/smarty/libs/sysplugins/smarty_internal_templatebase.php(116): Smarty_Internal_TemplateBase->_execute() #7 /path/to/photos/include/template.class.php(483): Smarty_Internal_TemplateBase->fetch() #8 /path/to/photos/include/template.class.php(406): Template->parse() #9 /path/to/photos/admin/cat_perm.php(297): Template->assign_var_from_handle() #10 /path/to/photos/admin/album.php(79): include('...') #11 /path/to/photos/admin.php(346): include('...') #12 {main} thrown in /path/to/photos/include/functions.inc.php on line 1260
When I restrict access to one user only, all is fine.
At Users - Groups I can reset the group's access right and then the error disappears.
What could be wrong?
Details of my installation:
Piwigo 14.2.0
Linux (Ubuntu 24.04)
PHP: 8.3.0-1ubuntu1
MySQL: 10.11.6-MariaDB-2
Afbeeldingen-bibliotheek: ImageMagick 6.9.12-98
Piwigo URL: http://hidden
Offline
Sounds the same like [Forum, topic 33485] Updating Permissions on PHP 8.0^.
Try switching language to English UK.
Offline
thanks, this workaround avoids the bug (when not only the site is set to English but separately also the user); in my opinion it's still a bug though, I make my site primarily for a Dutch audience, so I would like to see this fixed.
Grtz,
Benne
Offline
Yes of course it's a bug. Digging into language/nl_NL/admin.lang.php it looks like line 822 is the culprit:
$lang['%u users have automatic permission because they belong to a granted group.'] = '%jouw gebruikers hebben automatisch recht, omdat ze tot een groep behoren die dit recht is verleend';
The translation probably should be '%u gebruikers ...' instead of '%jouw gebruikers ...' (i.e. someone mistook the %u as %your).
If you could try?
Offline
Good catch, this is indeed the problem. Thanks.
Grtz,
Benne
PS I'm not sure what %u is, "jouw" is Dutch for "your", could that be what was meant here?
Offline
No, %u is a specifier for an unsigned integer variable's format in the PHP printf() function. The output will be something like "12 users have ..." or "12 gebruikers hebben ..."
%j is not a specifier at all.
Offline
makes sense, thanks again,
keep up the good work!
Grtz,
Benne
Offline
I submitted a pull request https://github.com/Piwigo/Piwigo/pull/2121
Offline