diff --git a/apps/comments/lib/Controller/Notifications.php b/apps/comments/lib/Controller/Notifications.php index f76f160534..c2a8175d17 100644 --- a/apps/comments/lib/Controller/Notifications.php +++ b/apps/comments/lib/Controller/Notifications.php @@ -102,13 +102,9 @@ class Notifications extends Controller { return new NotFoundResponse(); } - $dir = $this->folder->getRelativePath($files[0]->getParent()->getPath()); $url = $this->urlGenerator->linkToRouteAbsolute( - 'files.view.index', - [ - 'dir' => $dir, - 'scrollto' => $files[0]->getName() - ] + 'files.viewcontroller.showFile', + [ 'fileid' => $comment->getObjectId() ] ); $this->markProcessed($comment); diff --git a/apps/comments/tests/Unit/Controller/NotificationsTest.php b/apps/comments/tests/Unit/Controller/NotificationsTest.php index 5ab3978821..e887900a61 100644 --- a/apps/comments/tests/Unit/Controller/NotificationsTest.php +++ b/apps/comments/tests/Unit/Controller/NotificationsTest.php @@ -72,9 +72,6 @@ class NotificationsTest extends TestCase { ->will($this->returnValue($comment)); $file = $this->getMockBuilder('\OCP\Files\Node')->getMock(); - $file->expects($this->once()) - ->method('getParent') - ->will($this->returnValue($this->getMockBuilder('\OCP\Files\Folder')->getMock())); $this->folder->expects($this->once()) ->method('getById') @@ -106,10 +103,6 @@ class NotificationsTest extends TestCase { ->with('42') ->will($this->throwException(new NotFoundException())); - $file = $this->getMockBuilder('\OCP\Files\Node')->getMock(); - $file->expects($this->never()) - ->method('getParent'); - $this->folder->expects($this->never()) ->method('getById');