Batch manager is non-functional when using setlocale in config.inc.php #702

Open
opened 2026-10-05 00:12:37 +02:00 by adam · 8 comments
Owner

Batch Manager does not work when specifying an International charset with setlocale. Piwigo 2.9.1. Firefox 55.0.3

Very strange issue, but Quick Local Synchronization did not function when the filenames or directories contained International/Swedish characters. After a lot of troubleshooting, I found a solution by simply adding:

setlocale(LC_ALL,'sv_SE.utf8');
default

in the file config.inc.php.

All was fine and dandy. But I recently noticed that the Batch Manager page did not display correctly. The menu on the left is fully expanded (on all other menu items/pages it is only the current menu that is expanded) . Also, the Selection area doesn’t work. I.e. when I click on one of the: ‘The whole page, The whole set, None, Invert’, nothing happens. And the grey information box to the right is empty and very small. The browser also throws SyntaxErrors when I have the setlocale enabled.

default

default

image

After a whole lot of troubleshooting, I discovered that if I comment out the 'setlocale' line in my config.inc.php, and refresh the Batch Manager page – it displays perfectly.
default

default

default

So I am guessing there is something in the batch_manager.php script, or related files, that is charset or locale sensitive.

Anyone have ideas on where to report this and get it fixed? The setlocale is great for allowing Swedish characters everywhere else in Piwigo, and I would hate for the solution to fix Batch Manager to be – "Don't use setlocale".

Batch Manager does not work when specifying an International charset with setlocale. Piwigo 2.9.1. Firefox 55.0.3 Very strange issue, but Quick Local Synchronization did not function when the filenames or directories contained International/Swedish characters. After a lot of troubleshooting, I found a solution by simply adding: setlocale(LC_ALL,'sv_SE.utf8'); ![default](https://user-images.githubusercontent.com/31766952/30210421-ed0e6534-949c-11e7-9478-2cc531648e6f.png) in the file config.inc.php. All was fine and dandy. But I recently noticed that the Batch Manager page did not display correctly. The menu on the left is fully expanded (on all other menu items/pages it is only the current menu that is expanded) . Also, the Selection area doesn’t work. I.e. when I click on one of the: ‘The whole page, The whole set, None, Invert’, nothing happens. And the grey information box to the right is empty and very small. The browser also throws SyntaxErrors when I have the setlocale enabled. ![default](https://user-images.githubusercontent.com/31766952/30210433-f92a53d2-949c-11e7-827f-eb285b0024bc.png) ![default](https://user-images.githubusercontent.com/31766952/30210444-ff197df4-949c-11e7-8506-4f9f0b4072ee.png) ![image](https://user-images.githubusercontent.com/31766952/30210640-9dd3fd84-949d-11e7-90f8-e11b6e223966.png) After a whole lot of troubleshooting, I discovered that if I comment out the 'setlocale' line in my config.inc.php, and refresh the Batch Manager page – it displays perfectly. ![default](https://user-images.githubusercontent.com/31766952/30210467-0f316986-949d-11e7-92e8-5c0a4c51f10e.png) ![default](https://user-images.githubusercontent.com/31766952/30210472-1383452c-949d-11e7-92d9-6d5f07f54fd5.png) ![default](https://user-images.githubusercontent.com/31766952/30210478-1798c9e8-949d-11e7-8c9c-168e92c6bed1.png) So I am guessing there is something in the batch_manager.php script, or related files, that is charset or locale sensitive. Anyone have ideas on where to report this and get it fixed? The setlocale is great for allowing Swedish characters everywhere else in Piwigo, and I would hate for the solution to fix Batch Manager to be – "Don't use setlocale". <!-- github-sync-id:256230330 -->
Author
Owner

I confirm this issue on Piwigo 2.10.2 php7.0, 7.1, 7.2, 7.3

I confirm this issue on Piwigo 2.10.2 php7.0, 7.1, 7.2, 7.3 <!-- github-comment-id:608991642 -->
Author
Owner

@malien24 can you give us more details from your web browser console? We need something like "Syntax Error on line xxx" and if you click on the associated file name, it should show you the line.

My guess is that it's specific to a language which brings a string breaking the javascript code. We just need to findthis string and fix it.

@malien24 can you give us more details from your web browser console? We need something like "Syntax Error on line xxx" and if you click on the associated file name, it should show you the line. My guess is that it's specific to a language which brings a string breaking the javascript code. We just need to findthis string and fix it. <!-- github-comment-id:609006475 -->
Author
Owner

Ok.
If paste setlocale (LC_ALL, 'ru_RU.UTF-8'); in local/config/config.inc.php, BatchManager not working:
in top of page I see "Notice: A non well formed numeric value encountered in /var/www/piwigo/admin/batch_manager.php on line 788"
In console I see:
piwigo-console

Ok. If paste `setlocale (LC_ALL, 'ru_RU.UTF-8');` in local/config/config.inc.php, BatchManager not working: in top of page I see "Notice: A non well formed numeric value encountered in /var/www/piwigo/admin/batch_manager.php on line 788" In console I see: ![piwigo-console](https://user-images.githubusercontent.com/48380252/78424880-142f8380-7679-11ea-8195-188e95c0ff64.jpg) <!-- github-comment-id:609009088 -->
Author
Owner

If remove setlocale (LC_ALL, 'ru_RU.UTF-8');, all working

If remove `setlocale (LC_ALL, 'ru_RU.UTF-8');`, all working <!-- github-comment-id:609009183 -->
Author
Owner

OK, and if you click on the admin.php:910:15 at the end of the line of the web browser console, what do you see?

OK, and if you click on the `admin.php:910:15` at the end of the line of the web browser console, what do you see? <!-- github-comment-id:609020626 -->
Author
Owner

piwigo-console-admin910-15

piwigo-console-js

![piwigo-console-admin910-15](https://user-images.githubusercontent.com/48380252/78453545-1dc9e300-769b-11ea-9375-7d0bef8a6df4.jpg) ![piwigo-console-js](https://user-images.githubusercontent.com/48380252/78453605-7e592000-769b-11ea-878d-645a7aa823e9.jpg) <!-- github-comment-id:609038806 -->
Author
Owner

like at the first message I see that:
" The menu on the left is fully expanded (on all other menu items/pages it is only the current menu that is expanded) . Also, the Selection area doesn’t work. I.e. when I click on one of the: ‘The whole page, The whole set, None, Invert’, nothing happens. And the grey information box to the right is empty and very small. The browser also throws SyntaxErrors when I have the setlocale enabled."

like at the first message I see that: " The menu on the left is fully expanded (on all other menu items/pages it is only the current menu that is expanded) . Also, the Selection area doesn’t work. I.e. when I click on one of the: ‘The whole page, The whole set, None, Invert’, nothing happens. And the grey information box to the right is empty and very small. The browser also throws SyntaxErrors when I have the setlocale enabled." <!-- github-comment-id:609039777 -->
Author
Owner

in old versions of piwigo I must set "setlocale (LC_ALL, 'ru_RU.UTF-8');" in config.inc.php to piwigo work with cyrilic symbols in file names, and with upgrade to new versions, this function begin crash batch manager, but batch manager work without that string in piwigo 2.10.2 and piwigo understand cyrilic symbols....

in old versions of piwigo I must set "setlocale (LC_ALL, 'ru_RU.UTF-8');" in config.inc.php to piwigo work with cyrilic symbols in file names, and with upgrade to new versions, this function begin crash batch manager, but batch manager work without that string in piwigo 2.10.2 and piwigo understand cyrilic symbols.... <!-- github-comment-id:609040457 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#702