svenran15 reports a 'fix' by turning off manual sort order, but another user needs to keep that setting 'on'.
In the Forum discussion, user erAck suggests:
The code at https://github.com/Piwigo/Piwigo/blob/6 … l.php#L690 and following doesn't seem to be prepared for the case that the batch is not a category but $conf['order_by'] contains a sort order on rank. Only the piwigo_image_category table has a rank column, piwigo_images does not.
This issue was reported and discussed in the Piwigo Forum, [raised by user svenran15](https://piwigo.org/forum/viewtopic.php?id=31869)
svenran15 reports a 'fix' by turning off manual sort order, but another user needs to keep that setting 'on'.
In the Forum discussion, user erAck suggests:
> The code at [https://github.com/Piwigo/Piwigo/blob/6 … l.php#L690](https://github.com/Piwigo/Piwigo/blob/68e5901d7271335979f7ae49c77dd986427047c3/admin/batch_manager_global.php#L690) and following doesn't seem to be prepared for the case that the batch is not a category but $conf['order_by'] contains a sort order on rank. Only the piwigo_image_category table has a rank column, piwigo_images does not.
<!-- github-sync-id:1176973861 -->
I think the error message is different. Copying here from the Piwigo Forum post where this was discussed:
Code:
Warning: [mysql error 1054] Unknown column 'rank' in 'order clause'
SELECT id,path,representative_ext,file,filesize,level,name,width,height,rotation
FROM piwigo_images
WHERE id IN (251,252,253,254,255,256,257,258)
ORDER BY `rank` ASC
LIMIT 20 OFFSET 0
; in /home/oFtsiaCb6Qxw/wengam.com/archives/include/dblayer/functions_mysqli.inc.php on line 847
Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/oFtsiaCb6Qxw/wengam.com/archives/include/dblayer/functions_mysqli.inc.php:211 Stack trace: #0 /home/oFtsiaCb6Qxw/wengam.com/archives/admin/batch_manager_global.php(725): pwg_db_fetch_assoc(false) #1 /home/oFtsiaCb6Qxw/wengam.com/archives/admin/batch_manager.php(814): include('/home/oFtsiaCb6...') #2 /home/oFtsiaCb6Qxw/wengam.com/archives/admin.php(320): include('/home/oFtsiaCb6...') #3 {main} thrown in /home/oFtsiaCb6Qxw/wengam.com/archives/include/dblayer/functions_mysqli.inc.php on line 211
I think the error message is different. Copying here from the Piwigo Forum post where this was discussed:
```
Code:
Warning: [mysql error 1054] Unknown column 'rank' in 'order clause'
SELECT id,path,representative_ext,file,filesize,level,name,width,height,rotation
FROM piwigo_images
WHERE id IN (251,252,253,254,255,256,257,258)
ORDER BY `rank` ASC
LIMIT 20 OFFSET 0
; in /home/oFtsiaCb6Qxw/wengam.com/archives/include/dblayer/functions_mysqli.inc.php on line 847
Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /home/oFtsiaCb6Qxw/wengam.com/archives/include/dblayer/functions_mysqli.inc.php:211 Stack trace: #0 /home/oFtsiaCb6Qxw/wengam.com/archives/admin/batch_manager_global.php(725): pwg_db_fetch_assoc(false) #1 /home/oFtsiaCb6Qxw/wengam.com/archives/admin/batch_manager.php(814): include('/home/oFtsiaCb6...') #2 /home/oFtsiaCb6Qxw/wengam.com/archives/admin.php(320): include('/home/oFtsiaCb6...') #3 {main} thrown in /home/oFtsiaCb6Qxw/wengam.com/archives/include/dblayer/functions_mysqli.inc.php on line 211
```
<!-- github-comment-id:1090442399 -->
The cause is identical, table piwigo_images has no rank column, an order cause containing rank should be omitted if the query does not join table piwigo_image_category.
The cause is identical, table piwigo_images has no `rank` column, an order cause containing rank should be omitted if the query does not join table piwigo_image_category.
The #1616 fix https://github.com/Piwigo/Piwigo/commit/78e9d516b1ae548d54641504d3a7201781828f37 might address both occurrences but I didn't check.
<!-- github-comment-id:1094122050 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This issue was reported and discussed in the Piwigo Forum, raised by user svenran15
svenran15 reports a 'fix' by turning off manual sort order, but another user needs to keep that setting 'on'.
In the Forum discussion, user erAck suggests:
Is this the same as https://github.com/Piwigo/Piwigo/issues/1616 or is it yet something different?
I think the error message is different. Copying here from the Piwigo Forum post where this was discussed:
The cause is identical, table piwigo_images has no
rankcolumn, an order cause containing rank should be omitted if the query does not join table piwigo_image_category.The #1616 fix https://github.com/Piwigo/Piwigo/commit/78e9d516b1ae548d54641504d3a7201781828f37 might address both occurrences but I didn't check.
Let's close this issue. It seems to have been fixed as written by @erAck