diff --git a/cypress/e2e/share-link.js b/cypress/e2e/share-link.js index 2c61d12154..49999bef03 100644 --- a/cypress/e2e/share-link.js +++ b/cypress/e2e/share-link.js @@ -10,6 +10,7 @@ const otherUser = new User(randHash(), randHash()) describe.skip('Public sharing of office documents', () => { before(function() { + cy.nextcloudTestingAppConfigSet('richdocuments', 'doc_format', '') cy.createUser(shareOwner) cy.createUser(otherUser) diff --git a/cypress/e2e/talk.spec.js b/cypress/e2e/talk.spec.js index c1854fc67c..7cac42a9d5 100644 --- a/cypress/e2e/talk.spec.js +++ b/cypress/e2e/talk.spec.js @@ -11,6 +11,7 @@ describe('Talk integraiton integration', function() { cy.nextcloudTestingAppConfigSet('files', 'watermark_text', '{userId}') cy.nextcloudTestingAppConfigSet('files', 'watermark_shareTalkPublic', 'no') cy.nextcloudTestingAppConfigSet('richdocuments', 'uiDefaults-UIMode', 'notebookbar') + cy.nextcloudTestingAppConfigSet('richdocuments', 'doc_format', '') } before(function() { diff --git a/cypress/e2e/templates.spec.js b/cypress/e2e/templates.spec.js index 5310ecc466..5fc8d8a28a 100644 --- a/cypress/e2e/templates.spec.js +++ b/cypress/e2e/templates.spec.js @@ -9,6 +9,7 @@ describe('Global templates', function() { let randUser before(function() { + cy.nextcloudTestingAppConfigSet('richdocuments', 'doc_format', '') cy.createRandomUser().then(user => { randUser = user cy.createFolder(randUser, 'Templates-user') diff --git a/lib/AppConfig.php b/lib/AppConfig.php index 8b24ff48f3..cbbe46b475 100644 --- a/lib/AppConfig.php +++ b/lib/AppConfig.php @@ -39,6 +39,7 @@ class AppConfig { 'watermark_allTagsList' => [], 'watermark_linkTagsList' => [], 'token_ttl' => 36000, // 10 hours + 'doc_format' => 'ooxml', ]; public const WATERMARK_APP_NAMESPACE = 'files'; diff --git a/lib/Listener/RegisterTemplateFileCreatorListener.php b/lib/Listener/RegisterTemplateFileCreatorListener.php index 1f42c8dc0b..d17b1d208c 100644 --- a/lib/Listener/RegisterTemplateFileCreatorListener.php +++ b/lib/Listener/RegisterTemplateFileCreatorListener.php @@ -39,7 +39,7 @@ public function handle(Event $event): void { } $templateManager = $event->getTemplateManager(); - $ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', '') === 'ooxml'; + $ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', 'ooxml') === 'ooxml'; $appPath = $this->appManager->getAppPath('richdocuments'); $templateManager->registerTemplateFileCreator(function () use ($ooxml, $appPath) { diff --git a/lib/Service/SlideDeckService.php b/lib/Service/SlideDeckService.php index 4203791f3e..e15335b224 100644 --- a/lib/Service/SlideDeckService.php +++ b/lib/Service/SlideDeckService.php @@ -41,7 +41,7 @@ public function __construct( public function generateSlideDeck(?string $userId, string $presentationText) { $rawModelOutput = $this->runLLMQuery($userId, $presentationText); - $ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', '') === 'ooxml'; + $ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', 'ooxml') === 'ooxml'; $format = $ooxml ? 'pptx' : 'odp'; $emptyPresentation = $this->getBlankPresentation($format); diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 4a63621eed..b9475b22c0 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -45,7 +45,7 @@ public function getForm(): TemplateResponse { 'wopi_allowlist' => $this->config->getAppValue('richdocuments', 'wopi_allowlist'), 'edit_groups' => $this->config->getAppValue('richdocuments', 'edit_groups'), 'use_groups' => $this->config->getAppValue('richdocuments', 'use_groups'), - 'doc_format' => $this->config->getAppValue('richdocuments', 'doc_format'), + 'doc_format' => $this->config->getAppValue('richdocuments', 'doc_format', 'ooxml'), 'external_apps' => $this->config->getAppValue('richdocuments', 'external_apps'), 'canonical_webroot' => $this->config->getAppValue('richdocuments', 'canonical_webroot'), 'disable_certificate_verification' => $this->config->getAppValue('richdocuments', 'disable_certificate_verification', '') === 'yes', diff --git a/lib/TemplateManager.php b/lib/TemplateManager.php index b6553c1fac..6128d22100 100644 --- a/lib/TemplateManager.php +++ b/lib/TemplateManager.php @@ -413,7 +413,7 @@ private function getEmptyTemplateDir() { * @return array */ public function formatNodeReturn(File $template) { - $ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', '') === 'ooxml'; + $ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', 'ooxml') === 'ooxml'; $documentType = $this->flipTypes()[$template->getMimeType()]; return [ 'id' => $template->getId(), @@ -442,7 +442,7 @@ public function isTemplate($fileId) { } public function formatEmpty(File $template) { - $ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', '') === 'ooxml'; + $ooxml = $this->config->getAppValue(Application::APPNAME, 'doc_format', 'ooxml') === 'ooxml'; $documentType = $this->flipTypes()[$template->getMimeType()]; return [ 'id' => $template->getId(), diff --git a/src/components/AdminSettings.vue b/src/components/AdminSettings.vue index 492ea11d98..9f8c331ec8 100644 --- a/src/components/AdminSettings.vue +++ b/src/components/AdminSettings.vue @@ -532,6 +532,7 @@ export default { fonts: [], hasSettingIframeSupport: false, setting_iframe_url: '', + doc_format: null, }, accessToken: '', accessTokenTTL: '',