Issue 5320: Deleting of events returned a wrong message (#5663)

* Issue 5320: Deleting of events returned a wrong message

* Remove unneeded variable
This commit is contained in:
Michael Vogel 2018-08-25 21:38:54 +00:00 committed by Hypolite Petovan
parent dc4b6ba559
commit 3b50e94a1a

View 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);