aboutsummaryrefslogtreecommitdiff
path: root/mod/likes/actions
diff options
context:
space:
mode:
authorEvan Winslow <evan@elgg.org>2012-07-21 15:23:42 -0700
committerEvan Winslow <evan@elgg.org>2012-07-21 15:23:42 -0700
commit3cb2ce976fc024dfc700ef4500e5cddd01163e9c (patch)
treeedb4a9320d7d499b66832cfa5cf1a5548cad80fb /mod/likes/actions
parentb164c39ac5c82b311e9ef07fa01fcc464bab86b1 (diff)
downloadelgg-3cb2ce976fc024dfc700ef4500e5cddd01163e9c.tar.gz
elgg-3cb2ce976fc024dfc700ef4500e5cddd01163e9c.tar.bz2
Revert "Fixes #4606 made unlike code consistent and functional"
This reverts commit e3222535a07e39ffe506eb9688db515798ebf2a4.
Diffstat (limited to 'mod/likes/actions')
-rw-r--r--mod/likes/actions/likes/delete.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/mod/likes/actions/likes/delete.php b/mod/likes/actions/likes/delete.php
index 88cb84467..db3036bb4 100644
--- a/mod/likes/actions/likes/delete.php
+++ b/mod/likes/actions/likes/delete.php
@@ -4,12 +4,17 @@
*
*/
-$id = (int) get_input('id');
-$like = elgg_get_annotation_from_id($id);
-if ($like && $like->canEdit()) {
- $like->delete();
- system_message(elgg_echo("likes:deleted"));
- forward(REFERER);
+$likes = elgg_get_annotations(array(
+ 'guid' => (int) get_input('guid'),
+ 'annotation_owner_guid' => elgg_get_logged_in_user_guid(),
+ 'annotation_name' => 'likes',
+));
+if ($likes) {
+ if ($likes[0]->canEdit()) {
+ $likes[0]->delete();
+ system_message(elgg_echo("likes:deleted"));
+ forward(REFERER);
+ }
}
register_error(elgg_echo("likes:notdeleted"));