Localization fileds language order

Hi,

We’re trying to change the order of the languages in localized fields. Without any problem we could change the order in “validLanguages” in system.php on both our dev and staging environments but when we try to do the same on the production environment the changes do not change the order in Pimcore. They look right in the system.php file.

I have tried to clear all the caches and even force invalidation in opcache but without any effect. Do you guys have any tip? Im loosing my mind here because I can’t figure out why it does not work.

We’re using Redis as cache and opcache aswell, on both staging and production environments.

Best regards
Dzemal
Developer @ Ateles

Try looking at the Pimcore Backend User Configuration, you can set custom language order for each user.

1 Like

Thanks for the help!
Changing the language order on the user account helped but this will not apply to all the users but maybe its a good enough solution.

Thanks again!

We had a similar issue. I wrote this script which goes through each users and adds a new local to start of the language list:

   // get all users
    $list = new User\Listing();
    $list->setCondition('`type` = ?', ['user']);
    $list->load();

    $newLocal = 'en_001';
    foreach ($list->getItems() as $user) {
        if (!empty($user->getContentLanguages())) {
            if (count($user->getContentLanguages()) > 0) {
                $localList = $user->getContentLanguages();
                array_unshift($localList, $newLocal);
                $user->setContentLanguages($localList);
                $user->update();
            }
        }
    }