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:
parent
dc4b6ba559
commit
3b50e94a1a
1 changed files with 2 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue