From 70a422ddca3c4e430e41a4178b5ef61926b08386 Mon Sep 17 00:00:00 2001 From: Antipkin-A Date: Tue, 9 Nov 2021 13:41:17 +0300 Subject: [PATCH 1/5] move registration of preview provider from boot to register (Fix #544) --- appinfo/application.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/appinfo/application.php b/appinfo/application.php index f96eee5e..5df277ad 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -210,14 +210,19 @@ public function register(IRegistrationContext $context): void { $context->registerTemplateProvider(TemplateProvider::class); } + $container = $this->getContainer(); + + $previewManager = $container->query(IPreview::class); + $previewManager->registerProvider(Preview::getMimeTypeRegex(), function() use ($container) { + return $container->query(Preview::class); + }); + } public function boot(IBootContext $context): void { $context->injectFn(function (SymfonyAdapter $eventDispatcher) { - $container = $this->getContainer(); - if (class_exists("OCP\Files\Template\FileCreatedFromTemplateEvent")) { $eventDispatcher->addListener(FileCreatedFromTemplateEvent::class, function (FileCreatedFromTemplateEvent $event) { @@ -231,12 +236,6 @@ function (FileCreatedFromTemplateEvent $event) { } }); } - - $previewManager = $container->query(IPreview::class); - $previewManager->registerProvider(Preview::getMimeTypeRegex(), function() use ($container) { - return $container->query(Preview::class); - }); - }); $context->injectFn(function (IManager $notificationsManager) { From 4e94beef7be060fe38de33a506401c15bee527ca Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 9 Nov 2021 15:18:21 +0300 Subject: [PATCH 2/5] Revert "remove old version check" This reverts commit cb9eb58d5e5fbdaed28f4b683b6e8c00726ae5ab. # Conflicts: # controller/settingscontroller.php --- lib/documentservice.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/documentservice.php b/lib/documentservice.php index 50695067..c37522f6 100644 --- a/lib/documentservice.php +++ b/lib/documentservice.php @@ -414,6 +414,10 @@ public function checkDocServiceUrl($urlGenerator, $crypt) { } $version = $commandResponse->version; + $versionF = floatval($version); + if ($versionF > 0.0 && $versionF <= 6.0) { + throw new \Exception($this->trans->t("Not supported version")); + } } catch (\Exception $e) { $logger->logException($e, ["message" => "CommandRequest on check error", "app" => self::$appName]); From 9ca629b360edbe8065d61e2d602789c6170ae632 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Tue, 9 Nov 2021 15:32:11 +0300 Subject: [PATCH 3/5] update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d41022e5..dd3cc84b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## Added +- check document server version + +## Changed +- fix preview generation + ## 7.2.0 ## Added - set favicon on editor page From 30226fa16a81c7cf078287666675e3355a80d67a Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Wed, 1 Dec 2021 14:14:15 +0300 Subject: [PATCH 4/5] nc 23 (Fix #563) --- CHANGELOG.md | 1 + appinfo/info.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd3cc84b..52dd526b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## Changed - fix preview generation +- compatible with Nextcloud 23 ## 7.2.0 ## Added diff --git a/appinfo/info.xml b/appinfo/info.xml index 16592ff2..1296b9d9 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -29,7 +29,7 @@ https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/new.png https://raw.githubusercontent.com/ONLYOFFICE/onlyoffice-nextcloud/master/screenshots/open.png - + OCA\Onlyoffice\AdminSettings From 9c233f024ec921a20e50b2d13f271e8553b018af Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Thu, 2 Dec 2021 12:12:07 +0300 Subject: [PATCH 5/5] 7.2.1 --- CHANGELOG.md | 1 + appinfo/info.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52dd526b..ea137571 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Change Log +## 7.2.1 ## Added - check document server version diff --git a/appinfo/info.xml b/appinfo/info.xml index 1296b9d9..fbbda0df 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -6,7 +6,7 @@ ONLYOFFICE connector allows you to view, edit and collaborate on text documents, spreadsheets and presentations within Nextcloud using ONLYOFFICE Docs. This will create a new Edit in ONLYOFFICE action within the document library for Office documents. This allows multiple users to co-author documents in real time from the familiar web interface and save the changes back to your file storage. apache Ascensio System SIA - 7.2.0 + 7.2.1 Onlyoffice