As @kwazaro mentioned in #13002 there is an issue on some shared hosts that makes the manager unusable if the locale setting is not containing an utf8 capable locale.
It can't be reproduced here, but he said, that the system works fine on PHP7, but only if "locale" system setting is set to i.e. "en_GB.utf8". If he leaves locale parameter empty the Package Manager doesn't work, there are empty values in reports etc.
Some parts of the manager don't work, i.e. the Package Manager because of a broken JSON.
They should not break, if the MODX locale system setting is empty.
PHP7 on a russian shared host (as far as I know).
Yeah, this issue is pretty critical. Weird behavior too.
This error is about setLocale() php function behavior under server environment such as windows 7 as example.
It is also affects not only php7, here is my config Windows 7 Professional Edition Service Pack 1 Apache/2.4.17 (Win32) PHP/5.6.15
Here is some output from my config :
$this->getOption('locale')
"ru_RU.UTF8"
setlocale(LC_ALL, "ru_RU.UTF8")
false
setlocale(LC_ALL, "0")
"Russian_Russia.1251"
strftime('%b %d %Y', 1471864827)
"��� 22 2016"
Here is the root of problem, that causes incorrect symbols output in locale-dependent functions like strftime()
https://github.com/modxcms/revolution/blob/2.x/core/model/modx/modx.class.php#L2374
An approach to solve this would be:
I found temporary solution for this, while we waiting fo fix.
Edit 2 start files
In manager/index.php:
change
$modx->initialize('mgr');
to
$modx->initialize('mgr', ['setlocale'=>false]);
And in connectors/index.php:
$modx->initialize($ctx);
to
$modx->initialize($ctx, ['setlocale' => false]);
You even could create a MODX system setting setlocale and fill it with 0. Maybe a setmgrlocale system setting could be created. It would supercede the setlocale setting.
Can we close this? The system setting is introduced. As far as MODX goes there is not much more can be done here.
Ran consecutive updates from 2.2.16 to 2.5.7 and was left with a non-working package management.
Web inspector showed that /connectors/workspace/packages.php wasn't loading.
Finally found this thread and saved the suggested system setting to the dbase.
Voila, package management is back.
I Shouldn't this be closed when it also works after updating?
I agree. Feel free to reopen or comment if you disagree.
@modxbot close
Most helpful comment
You even could create a MODX system setting
setlocaleand fill it with 0. Maybe asetmgrlocalesystem setting could be created. It would supercede thesetlocalesetting.