diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-01-20 19:32:08 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-01-20 19:32:08 +0100 |
commit | 415e968612aef71dabaa8934117c72090a3fce2d (patch) | |
tree | f1cd61ac7af6fd9848ddcc87bc1eb161e4f6179e | |
parent | b5ae924031d175bf0cadee2375190615ab2edd84 (diff) | |
download | nextcloud-server-415e968612aef71dabaa8934117c72090a3fce2d.tar.gz nextcloud-server-415e968612aef71dabaa8934117c72090a3fce2d.zip |
fix renaming albums
-rw-r--r-- | apps/gallery/js/album_cover.js | 2 | ||||
-rw-r--r-- | apps/gallery/js/albums.js | 4 | ||||
-rw-r--r-- | apps/gallery/lib/album.php | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/apps/gallery/js/album_cover.js b/apps/gallery/js/album_cover.js index b871c3d89b5..44503de28e0 100644 --- a/apps/gallery/js/album_cover.js +++ b/apps/gallery/js/album_cover.js @@ -98,7 +98,7 @@ function galleryRename(name) { } $.getJSON("ajax/galleryOp.php", {operation: "rename", oldname: name, newname: result}, function(r) { if (r.status == "success") { - Albums.rename($(".gallery_album_box").filterAttr('data-album',albumName), result); + Albums.rename($(".gallery_album_box").filterAttr('data-album',name), result); } else { alert("Error: " + r.cause); } diff --git a/apps/gallery/js/albums.js b/apps/gallery/js/albums.js index f18d1deca4c..6150b0daa1e 100644 --- a/apps/gallery/js/albums.js +++ b/apps/gallery/js/albums.js @@ -75,8 +75,8 @@ Albums={ }, rename: function(element, new_name) { if (new_name) { - $(element).attr("title", new_name); - $("a", element).attr("href", "?view="+new_name); + $(element).attr("data-album", new_name); + $("a.view", element).attr("href", "?view="+new_name); $("h1", element).text(new_name); } } diff --git a/apps/gallery/lib/album.php b/apps/gallery/lib/album.php index d2c420eb9ef..4eb12cc0b81 100644 --- a/apps/gallery/lib/album.php +++ b/apps/gallery/lib/album.php @@ -28,7 +28,7 @@ class OC_Gallery_Album { } public static function rename($oldname, $newname, $owner) { - $stmt = OC_DB::prepare('UPDATE OR IGNORE *PREFIX*gallery_albums SET album_name=? WHERE uid_owner=? AND album_name=?'); + $stmt = OC_DB::prepare('UPDATE *PREFIX*gallery_albums SET album_name=? WHERE uid_owner=? AND album_name=?'); $stmt->execute(array($newname, $owner, $oldname)); } @@ -76,7 +76,7 @@ class OC_Gallery_Album { } public static function changePath($oldname, $newname, $owner) { - $stmt = OC_DB::prepare('UPDATE OR IGNORE *PREFIX*gallery_albums SET album_path=? WHERE uid_owner=? AND album_path=?'); + $stmt = OC_DB::prepare('UPDATE *PREFIX*gallery_albums SET album_path=? WHERE uid_owner=? AND album_path=?'); $stmt->execute(array($newname, $owner, $oldname)); } |