]> git.mxchange.org Git - friendica.git/commitdiff
Issue 5320: Deleting of events returned a wrong message (#5663)
authorMichael Vogel <icarus@dabo.de>
Sat, 25 Aug 2018 21:38:54 +0000 (21:38 +0000)
committerHypolite Petovan <mrpetovan@eml.cc>
Sat, 25 Aug 2018 21:38:54 +0000 (17:38 -0400)
* Issue 5320: Deleting of events returned a wrong message

* Remove unneeded variable

mod/events.php

index b4516cded9279eeb4b7f001052d2eb83979e94f3..91474022fcdc6277d9afa99e7f0438e9abd6333f 100644 (file)
@@ -542,16 +542,14 @@ function events_content(App $a) {
 
        // Remove an event from the calendar and its related items
        if ($mode === 'drop' && $event_id) {
-               $del = 0;
-
                $ev = Event::getListById(local_user(), $event_id);
 
                // Delete only real events (no birthdays)
                if (DBA::isResult($ev) && $ev[0]['type'] == 'event') {
-                       $del = Item::deleteForUser(['id' => $ev[0]['itemid']], local_user());
+                       Item::deleteForUser(['id' => $ev[0]['itemid']], local_user());
                }
 
-               if ($del == 0) {
+               if (Item::exists(['id' => $ev[0]['itemid']])) {
                        notice(L10n::t('Failed to remove event') . EOL);
                } else {
                        info(L10n::t('Event removed') . EOL);