From 6047493b6dba2a402f256d2286008c3baaa3d5f9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 11 Nov 2016 13:44:57 +0100 Subject: [PATCH] Fix integration tests Signed-off-by: Joas Schilling --- apps/dav/lib/CalDAV/Activity/Backend.php | 6 +++--- lib/private/Activity/Event.php | 5 ++++- lib/private/Activity/Manager.php | 12 ++---------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/apps/dav/lib/CalDAV/Activity/Backend.php b/apps/dav/lib/CalDAV/Activity/Backend.php index 6cf09f6de46..6a557fef7bd 100644 --- a/apps/dav/lib/CalDAV/Activity/Backend.php +++ b/apps/dav/lib/CalDAV/Activity/Backend.php @@ -112,7 +112,7 @@ class Backend { $event = $this->activityManager->generateEvent(); $event->setApp('dav') - ->setObject(Extension::CALENDAR, $calendarData['id']) + ->setObject(Extension::CALENDAR, (int) $calendarData['id']) ->setType(Extension::CALENDAR) ->setAuthor($currentUser); @@ -162,7 +162,7 @@ class Backend { $event = $this->activityManager->generateEvent(); $event->setApp('dav') - ->setObject(Extension::CALENDAR, $calendarData['id']) + ->setObject(Extension::CALENDAR, (int) $calendarData['id']) ->setType(Extension::CALENDAR) ->setAuthor($currentUser); @@ -387,7 +387,7 @@ class Backend { $event = $this->activityManager->generateEvent(); $event->setApp('dav') - ->setObject(Extension::CALENDAR, $calendarData['id']) + ->setObject(Extension::CALENDAR, (int) $calendarData['id']) ->setType($object['type'] === 'event' ? Extension::CALENDAR_EVENT : Extension::CALENDAR_TODO) ->setAuthor($currentUser); diff --git a/lib/private/Activity/Event.php b/lib/private/Activity/Event.php index c53335a316f..16c65c20853 100644 --- a/lib/private/Activity/Event.php +++ b/lib/private/Activity/Event.php @@ -539,10 +539,13 @@ class Event implements IEvent { $this->getAffectedUser() !== '' && $this->getTimestamp() !== 0 + /** + * Disabled for BC with old activities && $this->getObjectType() !== '' && - $this->getObjectId() !== '' + $this->getObjectId() !== 0 + */ ; } } diff --git a/lib/private/Activity/Manager.php b/lib/private/Activity/Manager.php index 35668a267ee..9c1629d79c2 100644 --- a/lib/private/Activity/Manager.php +++ b/lib/private/Activity/Manager.php @@ -173,14 +173,6 @@ class Manager implements IManager { * @throws \BadMethodCallException if required values have not been set */ public function publish(IEvent $event) { - $this->publishToConsumers($event, false); - } - - /** - * @param IEvent $event - * @param bool $legacyActivity - */ - protected function publishToConsumers(IEvent $event, $legacyActivity) { if ($event->getAuthor() === '') { if ($this->session->getUser() instanceof IUser) { $event->setAuthor($this->session->getUser()->getUID()); @@ -191,7 +183,7 @@ class Manager implements IManager { $event->setTimestamp(time()); } - if (!$legacyActivity && !$event->isValid()) { + if (!$event->isValid()) { throw new \BadMethodCallException('The given event is invalid'); } @@ -222,7 +214,7 @@ class Manager implements IManager { ->setObject('', 0, $file) ->setLink($link); - $this->publishToConsumers($event, true); + $this->publish($event); } /** -- 2.39.5