aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2022-10-14 10:42:13 +0200
committerGitHub <noreply@github.com>2022-10-14 10:42:13 +0200
commiteb911d344d950ee68a023b90b799c7ab16edbd63 (patch)
tree6eccd8731763e98abec8ee91156b282b17145c08 /apps
parentf49ccd140fd5ada0aa640f6642464ad149c980e6 (diff)
parent32c847b08c99b05a9655be7e03d5531cad198aa0 (diff)
downloadnextcloud-server-eb911d344d950ee68a023b90b799c7ab16edbd63.tar.gz
nextcloud-server-eb911d344d950ee68a023b90b799c7ab16edbd63.zip
Merge pull request #34595 from nextcloud/fix/invalid-template
Fix file creation issue if no action are registered
Diffstat (limited to 'apps')
-rw-r--r--apps/files/src/views/TemplatePicker.vue19
1 files changed, 11 insertions, 8 deletions
diff --git a/apps/files/src/views/TemplatePicker.vue b/apps/files/src/views/TemplatePicker.vue
index 3a1dc15b790..33b925aa2ed 100644
--- a/apps/files/src/views/TemplatePicker.vue
+++ b/apps/files/src/views/TemplatePicker.vue
@@ -215,20 +215,23 @@ export default {
)
this.logger.debug('Created new file', fileInfo)
+ // Fetch FileInfo and model
const data = await fileList?.addAndFetchFileInfo(this.name).then((status, data) => data)
-
const model = new OCA.Files.FileInfoModel(data, {
filesClient: fileList?.filesClient,
})
+
// Run default action
const fileAction = OCA.Files.fileActions.getDefaultFileAction(fileInfo.mime, 'file', OC.PERMISSION_ALL)
- fileAction.action(fileInfo.basename, {
- $file: fileList?.findFileEl(this.name),
- dir: currentDirectory,
- fileList,
- fileActions: fileList?.fileActions,
- fileInfoModel: model,
- })
+ if (fileAction) {
+ fileAction.action(fileInfo.basename, {
+ $file: fileList?.findFileEl(this.name),
+ dir: currentDirectory,
+ fileList,
+ fileActions: fileList?.fileActions,
+ fileInfoModel: model,
+ })
+ }
this.close()
} catch (error) {