Manual file sorting destroys inital order

Hello :slight_smile:,

i’ve run into a problem with sorting many images in the backend.

As a photographer, I generate galleries to display the images on my website.
Each gallery can have x amount of subpages, which store images. They are not accessible directly but get called and displayed on the main gallery template sorted by “sort, asc”. (Example: Example Gallery)

I export the images with sorting in filename e.g. 001_foo.jpg, 002_foo.jpg, …

On initial upload, all images are in the correct order.

When I try to sort one image in the backend, the whole order gets messed up sometimes. This seems to happen, because part of the images get a “sort” field in the metadata, but not all of them. Initially the images don’t have that field.

Is there an issuse with php execution time or else? Is kirby supposed to set a sort meta data to all files once i try to drag one image in the files field?

Thanks for your help!

Yes, all images should get a sorting number in their meta data file. Otherwise, the whole sorting stuff wouldn’t make sense. And yes, you might be running into a script execution timeout with loads of images. Do you get any error messages in your error logs?

Oh right, i get an error “server reached max_children setting (10), consider raising it”. Seems like my hosting is limiting max_children to 10, but that should be the error right? Maybe they can rise it.

On the other hand. Do you think i could set initial sorting via upload hook to reduce the amout of processed when drag & dropping?

You could, but that wouldn’t make a difference once you start sorting them manually. Unless you only want to sort them once in the order you upload them and then disable sorting.

Thanks for your help! I guess I will do the sorting offline & sort by filename. Seems to be the best solution.