[12.x, batch manager] order by rank does not work #1416

Closed
opened 2026-10-05 00:42:59 +02:00 by adam · 0 comments
Owner

If you use "manual sort order" in the default photos sort order, then batch manager will, most of the time, throw a "unknown column rank". The rank column must be used to sort photos only if we join with image_category table (which has the rank column...). The $conf['order_by'] should not have any rank in it (from admin/configuration.php):

// there is no rank outside categories
if ( ($i = array_search('rank ASC', $order_by)) !== false)
{ 
  unset($order_by[$i]);
}

BUT since rank became a reserved keyword in MySQL 8, Piwigo has added backticks to rank and of course, the search for rank ASC never works...

If you use "manual sort order" in the default photos sort order, then batch manager will, most of the time, throw a "unknown column rank". The `rank` column must be used to sort photos only if we join with `image_category` table (which has the `rank` column...). The `$conf['order_by']` should not have any `rank` in it (from `admin/configuration.php`): ``` // there is no rank outside categories if ( ($i = array_search('rank ASC', $order_by)) !== false) { unset($order_by[$i]); } ``` BUT since `rank` became a reserved keyword in MySQL 8, Piwigo has added backticks to `rank` and of course, the search for `rank ASC` never works... <!-- github-sync-id:1150438912 -->
adam closed this issue 2026-10-05 00:42:59 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1416