Can't remove non-existing pictures from non-existing Album directory. Can't remove non-existing pictures from non-existing Album directory.
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Can't remove non-existing pictures from non-existing Album directory.

Started by JasonB, August 07, 2005, 07:02:22 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

JasonB

This may seem silly, however I think it's a problem.  If I delete a picture, and its thumbnails, from disk and then go to the album to remove it from the gallery all is well (it does it, after having first displayed just the picture title rather than a thumb).  But if I delete the entire directory from disk, then go to the Album and try to delete a picture (or all pictures) I get the following error: "Directory 'albums/[Category]/[Album]/' is not writable, files can't be deleted", where [Category] and [Album] are replaced by the actual directory names.

Why does the deletion succeed if all of a picture's files are missing, but fail if the directory itself is missing?  What is it trying to do differently in both circumstances?  In any case, if the file isn't there for whatever reason, then it should silently (without an error) simply remove the entry from the gallery.

Note: I know that it makes more sense to just delete directly from the gallery itself.  However, I came across this because I'll frequently rename files.  To do this, I move the files elsewhere (so that they aren't "really" deleted), delete them from the gallery, rename the files, move them back, then batch add them in again (with the new filenames).

It would be nice if there were a "remove from gallery" option that would be like delete, except that it wouldn't touch the file system itself - rather it would just take the entry out of the database...

Joachim Müller

you're not meant to remove files physically (using FTP) once they exist in coppermine's database. Please refer to the docs. Makring as "invalid"

skidpics

Very true on the no deleting of files via FTP - However, I have the same problem, as I deleted my albums directory.. 

Easy way to fix the problem of deleting it appears, is to go to edit the properties of each album, scroll to the bottom and click the remove all files from the album.  NEXT, you can delete the album on the next step.. Without deleting the files (that are not there), you cannot delete the album..

Kinda weird you have to do it in 2 steps, rather than just with the album admin and deleting the albums.  If the pics are missing, it will not let you do it any other way...

Dia

Thanks Skidpics. I made the same mistake, I guess you don't know it's one until you get the error message, but I followed your advice and got it fixed. You go to album properties, all the way down to irreversibly delete files and once it allows you to do that you can delete the entire album.


Joachim Müller