From fa8b09f713b3ea2242ee782aefd6c953db1da742 Mon Sep 17 00:00:00 2001 From: codewithvk Date: Thu, 27 Feb 2025 16:55:45 +0530 Subject: [PATCH] fix: CI fix Signed-off-by: codewithvk --- lib/Controller/WopiController.php | 9 ++++++--- lib/Middleware/WOPIMiddleware.php | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php index 10fe1f0ae2..12fa0d0647 100644 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -178,9 +178,7 @@ public function checkFileInfo(string $fileId, string $access_token): JSONRespons if ($this->capabilitiesService->hasSettingIframeSupport()) { if (!$isPublic) { - // FIXME: Figure out what is going on here - // have not yet been able to trace the issue - // $response['UserSettings'] = $this->generateSettings($userId, 'userconfig'); + $response['UserSettings'] = $this->generateSettings($userId, 'userconfig'); } $response['SharedSettings'] = $this->generateSettings($userId, 'systemconfig'); } @@ -437,8 +435,13 @@ public function uploadSettingsFile(string $fileId, string $access_token): JSONRe try { $wopi = $this->wopiMapper->getWopiForToken($access_token); + // may be we are handling both types?? $userId = $wopi->getEditorUid(); + if (empty($userId)) { + throw new \Exception('UserID is empty'); + } + $content = fopen('php://input', 'rb'); if (!$content) { throw new \Exception('Failed to read input stream.'); diff --git a/lib/Middleware/WOPIMiddleware.php b/lib/Middleware/WOPIMiddleware.php index de5aa2322f..613c9e7db4 100644 --- a/lib/Middleware/WOPIMiddleware.php +++ b/lib/Middleware/WOPIMiddleware.php @@ -55,6 +55,10 @@ public function beforeController($controller, $methodName) { return; } + if (strpos($this->request->getRequestUri(), 'wopi/settings/upload') !== false) { + return; + } + try { $fileId = $this->request->getParam('fileId'); $accessToken = $this->request->getParam('access_token');