From: Michael Vogel Date: Sat, 25 Aug 2018 21:38:54 +0000 (+0000) Subject: Issue 5320: Deleting of events returned a wrong message (#5663) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3b50e94a1abbd219357716d919acbc7ea132ba01;p=friendica.git Issue 5320: Deleting of events returned a wrong message (#5663) * Issue 5320: Deleting of events returned a wrong message * Remove unneeded variable --- diff --git a/mod/events.php b/mod/events.php index b4516cded9..91474022fc 100644 --- a/mod/events.php +++ b/mod/events.php @@ -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);