Manual gallery sorting on multi language site?

Have you tested this in a current 2.5.12 Starterkit? If you could do that, it would be really helpful, as I won’t get to testing this today.

OK, i did that :

  • Download the last Starterkit on Github
  • Set a test role inside the config as below
  • Set permission panel.file.sort to false for this role
  • Create a test user with a test role and login him

And I’m still able to sort files.

// site/config.php
c::set('roles', [
    [
        'id'      => 'test',
        'name'    => 'Test',
        'panel'   => true,
        'permissions' => [
            '*'               => true,
            'panel.file.sort' => false
        ]
    ]
]);

Just for testing, once again I replaced panel.file.sort by panel.page.update, and as normally expected I’m not able anymore to update any page. So it seems to be a problem with panel.file.sort, no ?

I did a quick test and it turns out it works but maybe not quite as expected. I used the following code. in /site/roles/editor.php:

<?php

// site/roles/editor.php
return [
  'name'        => 'Editor',
    'default'     => false,
    'permissions' => [
      '*'               => true,
      'panel.file.sort' => function() {
        return $this->site()->language() == 'en'; // where en is the default language
      }
    ]
];

In the blueprint, I had to set sortable:true.

What happens is the following:

  • in the default language, you can sort the files and the meta data file is created
  • in the non-default language, it looks as if you could sort the files, i.e. you can drag them around, but as soon as you refresh the page, the default order is restored. Kirby doesn’t create a meta file for this language.
1 Like

Indeed ! Sorry I didn’t see that, and thank you for your time ! :slight_smile: