Announcement

#1 2024-02-26 16:30:49

deweger
Member
2024-02-26
4

error on restricting album to group

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

 

#2 2024-02-26 17:36:43

erAck
Only trying to help
2015-09-06
2091

Re: error on restricting album to group

Sounds the same like [Forum, topic 33485] Updating Permissions on PHP 8.0^.
Try switching language to English UK.


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2024-02-26 19:35:14

deweger
Member
2024-02-26
4

Re: error on restricting album to group

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

 

#4 2024-02-27 11:05:39

erAck
Only trying to help
2015-09-06
2091

Re: error on restricting album to group

Yes of course it's a bug. Digging into language/nl_NL/admin.lang.php it looks like line 822 is the culprit:

Code:

$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?


Running Piwigo at https://erack.net/gallery/

Offline

 

#5 2024-02-27 11:25:39

deweger
Member
2024-02-26
4

Re: error on restricting album to group

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

 

#6 2024-02-27 21:46:08

erAck
Only trying to help
2015-09-06
2091

Re: error on restricting album to group

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.


Running Piwigo at https://erack.net/gallery/

Offline

 

#7 2024-02-27 21:57:33

deweger
Member
2024-02-26
4

Re: error on restricting album to group

makes sense, thanks again,
keep up the good work!

Grtz,
Benne

Offline

 

#8 2024-02-27 22:09:02

erAck
Only trying to help
2015-09-06
2091

Re: error on restricting album to group

I submitted a pull request https://github.com/Piwigo/Piwigo/pull/2121


Running Piwigo at https://erack.net/gallery/

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact