From c73dd526df13a0953073cf76871349378d4308d3 Mon Sep 17 00:00:00 2001 From: Ahmed Mazen Date: Sun, 20 Aug 2023 13:44:56 +0800 Subject: [PATCH] OO disallow " (copy)" from being added to files used with template Pull Request #1067 added " (copy)" to copied OnlyOffice files. But, it made a mistake in the sense that it added it to all files that use a template. (copied files use template internally). This pull request allows users to create a file using a template without " (copy)" being added. --- www/common/onlyoffice/inner.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 1634e4edc..a5d93e629 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -235,13 +235,14 @@ define([ var getFileType = function () { - var type = common.getMetadataMgr().getPrivateData().ooType; + var priv = common.getMetadataMgr().getPrivateData(); + var type = priv.ooType; var title = common.getMetadataMgr().getMetadataLazy().title; if (APP.downloadType) { type = APP.downloadType; title = "download"; } - if(title === "" && APP.startWithTemplate) { + if(title === "" && APP.startWithTemplate && priv.fromFileData) { var metadata = APP.startWithTemplate.content.metadata; var copyTitle = Messages._getKey('copy_title', [metadata.title || metadata.defaultTitle]); common.getMetadataMgr().updateTitle(copyTitle);