[11.x admin/album move] wrong album rank when moving #1150

Closed
opened 2026-10-05 00:33:13 +02:00 by adam · 1 comment
Owner

When moving A/A1 to the root of the gallery, I think pwg.categories.move and pwg.categories.setRank are called in parallel. That's a problem because setRank relies on the current list of albums in the same parent album. The JS code must wait for the response of pwg.categories.move before calling pwg.categories.setRank.

Currently, it generates a random result. If you have luck you will think it's fine, but another time you get an inverted rank at page reload...

When moving A/A1 to the root of the gallery, I think `pwg.categories.move` and `pwg.categories.setRank` are called in parallel. That's a problem because `setRank` relies on the current list of albums in the same parent album. The JS code must wait for the response of `pwg.categories.move` before calling `pwg.categories.setRank`. Currently, it generates a random result. If you have luck you will think it's fine, but another time you get an inverted rank at page reload... <!-- github-sync-id:802346658 -->
adam closed this issue 2026-10-05 00:33:13 +02:00
Author
Owner

In any case it would be related: when you reorder an album to the first rank (at the root), pwg.categories.move is called, even if the parent does not change.

In any case it would be related: when you reorder an album to the first rank (at the root), `pwg.categories.move` is called, even if the parent does not change. <!-- github-comment-id:774187223 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1150