]> source.dussan.org Git - nextcloud-server.git/commitdiff
db cleanup after gallery remove
authorBartek Przybylski <bart.p.pl@gmail.com>
Wed, 25 Jan 2012 20:15:27 +0000 (21:15 +0100)
committerBartek Przybylski <bart.p.pl@gmail.com>
Wed, 25 Jan 2012 20:15:27 +0000 (21:15 +0100)
apps/gallery/ajax/galleryOp.php

index f162fe2bc467e1c2f12356c21905583ae2fe5e50..0c2674f885931aa5c4eb76b4ff7227e1b848c7ad 100644 (file)
@@ -34,7 +34,11 @@ function handleRename($oldname, $newname) {
 
 function handleRemove($name) {
   OC_JSON::checkLoggedIn();
+  $album_id = OC_Gallery_Album::find(OC_User::getUser(), $name);
+  $album_id = $album_id->fetchRow();
+  $album_id = $album_id['album_id'];
   OC_Gallery_Album::remove(OC_User::getUser(), $name);
+  OC_Gallery_Photo::removeByAlbumId($album_id);
 }
 
 function handleGetThumbnails($albumname) {