[albums] Batch-managing a since-deleted album gives SQL error #258

Closed
opened 2026-10-04 23:49:22 +02:00 by adam · 3 comments
Owner

Reported by samwilson on 24 May 2014 23:26

Version: 2.6.2

Hello,

I had the batch-manager open for a single album, then in another window deleted that album (it no longer had any photos in it), and when I came back to the batch-manager to move to a different album it gave me the following error:

Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3

SELECT DISTINCT(image_id)
FROM image_category
WHERE category_id IN ()
; in /home/user/photos.example.com/include/dblayer/functions_mysqli.inc.php on line 798

Fatal error: Call to a member function fetch_assoc() on a non-object in /home/user/photos.example.com/include/dblayer/functions_mysqli.inc.php on line 181

The URL was: http://photos.example.com/admin.php?page=batch_manager

Please let me know if I can provide any more information.

Piwigo Bugtracker #3084

**Reported by samwilson on 24 May 2014 23:26** **Version:** 2.6.2 Hello, I had the batch-manager open for a single album, then in another window deleted that album (it no longer had any photos in it), and when I came back to the batch-manager to move to a different album it gave me the following error: Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;)&#039; at line 3 SELECT DISTINCT(image_id) FROM image_category WHERE category_id IN () ; in /home/user/photos.example.com/include/dblayer/functions_mysqli.inc.php on line 798 Fatal error: Call to a member function fetch_assoc() on a non-object in /home/user/photos.example.com/include/dblayer/functions_mysqli.inc.php on line 181 The URL was: http://photos.example.com/admin.php?page=batch_manager Please let me know if I can provide any more information. [Piwigo Bugtracker #3084](http://piwigo.org/bugs/view.php?id=3084) <!-- github-sync-id:97226791 -->
adam closed this issue 2026-10-04 23:49:22 +02:00
Author
Owner

@samwilson I have encountered this (very rare) problem today. It happened if:

  1. you filter Batch Manager on an album, with the option "include sub-albums" checked
  2. you delete the album
  3. you refresh the Batch Manager
@samwilson I have encountered this (very rare) problem today. It happened if: 1. you filter Batch Manager on an album, with the option "include sub-albums" checked 2. you delete the album 3. you refresh the Batch Manager <!-- github-comment-id:402985967 -->
Author
Owner

Thank you for fixing it! :)

Thank you for fixing it! :) <!-- github-comment-id:402989702 -->
Author
Owner

@samwilson it only took 4 years ;-) (I think we had not been able to reproduce it, which made it very complicated to fix)

@samwilson it only took 4 years ;-) (I think we had not been able to reproduce it, which made it very complicated to fix) <!-- github-comment-id:402999212 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#258