Possible bug - Deleting old pic:empty token still remains in the thumbnails list Possible bug - Deleting old pic:empty token still remains in the thumbnails list
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Possible bug - Deleting old pic:empty token still remains in the thumbnails list

Started by flapane, February 01, 2015, 01:26:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

flapane

I've just downloaded a quite old image (uploaded probably with cpg1.3).
I got a message stating that the original/medium/thumb JPG files have been deleted, but the "image" couldn't be removed.
In fact, now the album displays an empty token for the deleted image. It also displays the total visits (73), as shown in the attached file (2.PNG).

I tried to search for the pid of the image (173) in the cpg_pictures sql table, but I couldn't find anything, as shown in the other attached file (1.PNG). PIDs 172 and 174 are present, but 173 isn't, which should be the expected behaviour, if one deletes that image.

I also tried a wider research in the sql dbase, but it didn't give any results for that pid:
SELECT *
FROM `flapanec_db`.`cpg_pictures`
WHERE (
CONVERT( `pid`
USING utf8 ) LIKE '%173%'
)
ORDER BY `cpg_pictures`.`pid` ASC
LIMIT 0 , 30


In order to solve this, I manually had to type the URL of the (partially) deleted image, and click on DELETE FILE another time. It still said that it couldn't remove the image from the album, as shown in attachment 3.PNG, but it eventually removed the empty token from the thumbnails list.

I'm pretty sure that this doesn't happen with pics uploaded recently with cpg 1.5, because I've deleted some images in the last months, and no empty token remained in the thumbnails list.
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré

Quote from: flapane on February 01, 2015, 01:26:30 PM
I've just downloaded a quite old image (uploaded probably with cpg1.3).
I assume this should read
QuoteI've just deleted a quite old image
?

Do you have a backup of your database and files and can reproduce that issue on exactly that image? If not, I think this will be classified as "shit happens", as I don't think this is related to when the picture has been uploaded (with whatever version) ;)

flapane

Sorry, that's of course a "deleted", I've no idea why I wrote "downloaded".  :D

I do have a backup, but for now, just for sparing time (as of now I can't upload the old dbase, I should set up a local sql server), I tried with another (old) image in the same album: it still materially deletes the JPG thumb/intermediate/normal files, and it says that the "image in the album" can't be deleted (red circle icon, first from the right), as shown in the attachment 3.PNG I previously attached.
However, this time it doesn't show an empty token in the thumbnails list, so the final result looks good.
Still, I'm not sure why the "image in the album" can't be deleted and the icon is red, and if this is the expected behaviour.
I thought that it was worthwile to report what happened.
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré

Quote from: flapane on February 01, 2015, 10:47:35 PM
I'm not sure why the "image in the album" can't be deleted and the icon is red, and if this is the expected behaviour.
That's of course not expected behavior. Obviously it got deleted in the database (= get deleted in the album): 1.PNG. Regarding pid 173 and 2.PNG, this is maybe some kind of weird cache behavior?

If Coppermine tells that the image couldn't get deleted from the album (= database record), 2.PNG would be expected result. But as you proved in 1.PNG, it actually got deleted from the database.

I've currently no clue why this happens. I need to review the code, but I've no more spare time today.

flapane

The cache (which I've just emptied) could be a good call for the "ghost" empty token after having deleted the image, as I'm not able to reproduce it anymore with other images.

After having wiped the cache, having re-uploaded the latest cpg version and having logged out, I tried to delete another couple of images, and I can confirm that the red circle icon still appears, even if no visible issue pops up.
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré

Quote from: flapane on February 01, 2015, 11:36:07 PM
I tried to delete another couple of images, and I can confirm that the red circle icon still appears

Fixed in SVN revision 8770. I added this glitch in SVN revision 8223 (3.5 years ago :o). Thanks for the report, feel free to verify the fix :)

flapane

Thanks for keeping cpg alive and kicking, can't wait to try it as soon as SF returns back online. :)
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

flapane

Flapane
www.flapane.com

Gallery
www.gallery.flapane.com