[15.0.0] parent album deletion generates batch management errors #1958

Closed
opened 2026-10-05 01:02:19 +02:00 by adam · 3 comments
Owner

After installing and setting up Piwigo, I created a hierarchical album structure as follows:

  • Parent album: "Art"

    • Sub-albums: "Art1", "Art2", "Art3"

I uploaded several photos into these sub-albums. When I deleted the parent album "Art," I selected the option to keep the photos. Following this deletion, I encountered the following unexpected behavior:

  1. Photos remained as orphans, and accessing the Orphan Photos, Batch Manager, or Recent Photos sections resulted in the following error:
Warning: Array to string conversion in /app/www/public/include/functions_category.inc.php on line 159

Fatal error: Uncaught mysqli_sql_exception: Unknown column 'Array' in 'where clause' in /app/www/public/include/dblayer/functions_mysqli.inc.php:132
Stack trace:
#0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query()
#1 /app/www/public/include/functions_category.inc.php(161): pwg_query()
#2 /app/www/public/include/functions_html.inc.php(186): get_cat_info()
#3 /app/www/public/admin/include/batch_manager_filters.inc.php(119): get_cat_display_name_from_id()
#4 /app/www/public/admin/batch_manager_global.php(434): include('...')
#5 /app/www/public/admin/batch_manager.php(812): include('...')
#6 /app/www/public/admin.php(346): include('...')
#7 {main} thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132

Steps to Reproduce:

Create a parent album and add sub-albums.
Upload photos to the sub-albums.
Delete the parent album and select the option to retain photos.
Access sections like Orphan Photos, Basket (I don't know if 'basket' is the correct word, my menu is in another language, sorry) , Batch Manager, or Recent Photos.

Edit: I dropped the database and started a new installation, and confirmed that this is indeed an error. I have inserted screenshots to better illustrate.

Captura de tela de 2024-10-25 13-37-39
Captura de tela de 2024-10-25 13-39-50

Expected Behavior: Parent and sub-albums should be deleted, the orphaned photos should not trigger an error in the Batch Manager or Orphan Photos sections.

After installing and setting up Piwigo, I created a hierarchical album structure as follows: - Parent album: "Art" - Sub-albums: "Art1", "Art2", "Art3" I uploaded several photos into these sub-albums. When I deleted the parent album "Art," I selected the option to keep the photos. Following this deletion, I encountered the following unexpected behavior: 1. Photos remained as orphans, and accessing the Orphan Photos, Batch Manager, or Recent Photos sections resulted in the following error: ``` Warning: Array to string conversion in /app/www/public/include/functions_category.inc.php on line 159 Fatal error: Uncaught mysqli_sql_exception: Unknown column 'Array' in 'where clause' in /app/www/public/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /app/www/public/include/functions_category.inc.php(161): pwg_query() #2 /app/www/public/include/functions_html.inc.php(186): get_cat_info() #3 /app/www/public/admin/include/batch_manager_filters.inc.php(119): get_cat_display_name_from_id() #4 /app/www/public/admin/batch_manager_global.php(434): include('...') #5 /app/www/public/admin/batch_manager.php(812): include('...') #6 /app/www/public/admin.php(346): include('...') #7 {main} thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132 ``` **Steps to Reproduce:** Create a parent album and add sub-albums. Upload photos to the sub-albums. Delete the parent album and select the option to retain photos. Access sections like Orphan Photos, Basket (I don't know if 'basket' is the correct word, my menu is in another language, sorry) , Batch Manager, or Recent Photos. Edit: I dropped the database and started a new installation, and confirmed that this is indeed an error. I have inserted screenshots to better illustrate. ![Captura de tela de 2024-10-25 13-37-39](https://github.com/user-attachments/assets/d980543d-5918-4d80-918f-0a61533c3ae9) ![Captura de tela de 2024-10-25 13-39-50](https://github.com/user-attachments/assets/796c6a91-37d8-4d8e-bab8-41fde830ca62) Expected Behavior: Parent and sub-albums should be deleted, the orphaned photos should not trigger an error in the Batch Manager or Orphan Photos sections. <!-- github-sync-id:2613955510 -->
adam closed this issue 2026-10-05 01:02:19 +02:00
Author
Owner

Hello, do you have the error without deleting orphan photos?

As soon as you have the error, you can go to Ferramentas > Manutenção and perform the Atualizar as informações das fotos. This will perform an invalidate_user_cache which may solve your problem. We're still looking for a solution because in my case I can't reproduce your particular problem.

However, in Piwigo, when you delete a parent album that has sub-albums, all the albums are deleted and if you have photos they become orphaned.

Hello, do you have the error without deleting orphan photos? As soon as you have the error, you can go to `Ferramentas > Manutenção` and perform the `Atualizar as informações das fotos`. This will perform an `invalidate_user_cache` which may solve your problem. We're still looking for a solution because in my case I can't reproduce your particular problem. However, in Piwigo, when you delete a parent album that has sub-albums, all the albums are deleted and if you have photos they become orphaned. <!-- github-comment-id:2438389670 -->
Author
Owner

I just confirmed on a new installation, with a new database, that creating the structure again, uploading the subdirectories, and deleting the parent album along with the orphan photos, the same problem occurs.

Warning: Array to string conversion in /app/www/public/include/functions_category.inc.php on line 159

Fatal error: Uncaught mysqli_sql_exception: Unknown column 'Array' in 'where clause' in /app/www/public/include/dblayer/functions_mysqli.inc.php:132 
Stack trace:
 #0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() 
 #1 /app/www/public/include/functions_category.inc.php(161): pwg_query() #2 /app/www/public/include/functions_html.inc.php(186): get_cat_info()
 #3 /app/www/public/admin/include/batch_manager_filters.inc.php(119): get_cat_display_name_from_id()
 #4 /app/www/public/admin/batch_manager_global.php(434): include('...')
 #5 /app/www/public/admin/batch_manager.php(812): include('...')
 #6 /app/www/public/admin.php(346): include('...')
 #7 {main} thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132

Perfom Atualizar as informações das fotos does not work, when a go to " Batch Manager" for example, I still have problems.
Captura de tela de 2024-10-25 15-07-26

Creating a new album and uploading a photo to it solves the problem. It seems to me that the problem is somewhere in this code snippet, but unfortunately, I am not a PHP dev, I don't know how to debug properly.

##https://github.com/Piwigo/Piwigo/blob/65dce73ef82b18e0cd8ff5359ce7624206c5bdbb/admin/include/batch_manager_filters.inc.php#L101-L121

Anyway, since I'm starting a clean install, I can avoid the problem by creating a new album and adding a photo to it, the goal was just to let the team know. If you think it's better, you can close the issue. Thanks for the help!

I just confirmed on a new installation, with a new database, that creating the structure again, uploading the subdirectories, and deleting the parent album along with the orphan photos, the same problem occurs. ``` Warning: Array to string conversion in /app/www/public/include/functions_category.inc.php on line 159 Fatal error: Uncaught mysqli_sql_exception: Unknown column 'Array' in 'where clause' in /app/www/public/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() #1 /app/www/public/include/functions_category.inc.php(161): pwg_query() #2 /app/www/public/include/functions_html.inc.php(186): get_cat_info() #3 /app/www/public/admin/include/batch_manager_filters.inc.php(119): get_cat_display_name_from_id() #4 /app/www/public/admin/batch_manager_global.php(434): include('...') #5 /app/www/public/admin/batch_manager.php(812): include('...') #6 /app/www/public/admin.php(346): include('...') #7 {main} thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132 ``` Perfom `Atualizar as informações das fotos` does not work, when a go to " Batch Manager" for example, I still have problems. ![Captura de tela de 2024-10-25 15-07-26](https://github.com/user-attachments/assets/bed80c0c-a88b-46e0-8fea-5c76414917c5) **Creating a new album and uploading a photo to it solves the problem**. It seems to me that the problem is somewhere in this code snippet, but unfortunately, I am not a PHP dev, I don't know how to debug properly. ##https://github.com/Piwigo/Piwigo/blob/65dce73ef82b18e0cd8ff5359ce7624206c5bdbb/admin/include/batch_manager_filters.inc.php#L101-L121 Anyway, since I'm starting a clean install, I can avoid the problem by creating a new album and adding a photo to it, the goal was just to let the team know. If you think it's better, you can close the issue. Thanks for the help! <!-- github-comment-id:2438545584 -->
Author
Owner

I was able to reproduce the problem, and we have a solution that will be in the next release (15.1.0)!

Thanks for your feedback! 😃

I was able to reproduce the problem, and we have a solution that will be in the next release (15.1.0)! Thanks for your feedback! 😃 <!-- github-comment-id:2446215745 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1958