Piwigo / Piwigo-Mobile

Piwigo iOS Mobile Application
MIT License
100 stars 29 forks source link

[BUG] Crash when default album has been deleted with the web UI #486

Closed PlatoniusIII closed 2 years ago

PlatoniusIII commented 2 years ago

Describe the bug and how to reproduce In the IOS app set default album to a specific album Then go to the web interface and delete that album.

Problems occuring:

  1. Now if you open the iOS app, it shows no images in folder, but when you press the cog wheel, it crashes.

  2. If you have the auto-upload feature set to the deleted directory, images are still uploaded but orphaned!

  3. If I create an album in the web interface with the same name (which technically is a different album), going to the permissions page in the web interface generates a SQL-error:

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

  SELECT id, name, permalink
    FROM piwigo_categories
    WHERE id IN (,11)
  ; in /var/www/piwigo/piwigo/include/dblayer/functions_mysqli.inc.php on line 847

Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool in /var/www/piwigo/piwigo/include/dblayer/functions_mysqli.inc.php:900 Stack trace: #0 /var/www/piwigo/piwigo/include/functions_category.inc.php(193): query2array('\n SELECT id, n...', 'id') #1 /var/www/piwigo/piwigo/include/functions_html.inc.php(185): get_cat_info('11') #2 /var/www/piwigo/piwigo/admin/cat_perm.php(176): get_cat_display_name_from_id('11', 'admin.php?page=...') #3 /var/www/piwigo/piwigo/admin/album.php(69): include('/var/www/piwigo...') #4 /var/www/piwigo/piwigo/admin.php(314): include('/var/www/piwigo...') #5 {main} thrown in /var/www/piwigo/piwigo/include/dblayer/functions_mysqli.inc.php on line 900

Expected behavior

  1. I guess that the app catches if the directory is removed and switches to root.
  2. Give an error message and stop uploading (or at least ask if it needs to continue uploading)
  3. Something isn't deleted properly I guess...

Smartphone (please complete the following information):

Additional context

EddyLB commented 2 years ago

Fixed in version 2.9