aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-03-29 23:43:22 +0100
committerGitHub <noreply@github.com>2024-03-29 23:43:22 +0100
commitae28d13778c06cdb62cb3013e8f264c95b96e92b (patch)
treef547f40e6845cec400ec06958c29788f360f4111 /apps
parent6044442ecf92a6c4a6d50b544663aaa705b3c211 (diff)
parentedc40243cc5aa655af1e015e6f1eaa8725d28262 (diff)
downloadnextcloud-server-ae28d13778c06cdb62cb3013e8f264c95b96e92b.tar.gz
nextcloud-server-ae28d13778c06cdb62cb3013e8f264c95b96e92b.zip
Merge pull request #44570 from nextcloud/backport/44569/stable28
[stable28] fix(files_sharing): Create passwords when enforced for mail shares
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/src/models/Share.js6
-rw-r--r--apps/files_sharing/src/views/SharingDetailsTab.vue11
2 files changed, 7 insertions, 10 deletions
diff --git a/apps/files_sharing/src/models/Share.js b/apps/files_sharing/src/models/Share.js
index 5504c63b345..b88d376a0ff 100644
--- a/apps/files_sharing/src/models/Share.js
+++ b/apps/files_sharing/src/models/Share.js
@@ -43,11 +43,11 @@ export default class Share {
ocsData.hide_download = !!ocsData.hide_download
ocsData.mail_send = !!ocsData.mail_send
- if (ocsData.attributes) {
+ if (ocsData.attributes && typeof ocsData.attributes === 'string') {
try {
ocsData.attributes = JSON.parse(ocsData.attributes)
} catch (e) {
- console.warn('Could not parse share attributes returned by server: "' + ocsData.attributes + '"')
+ console.warn('Could not parse share attributes returned by server', ocsData.attributes)
}
}
ocsData.attributes = ocsData.attributes ?? []
@@ -310,7 +310,7 @@ export default class Share {
* @memberof Share
*/
get label() {
- return this._share.label
+ return this._share.label ?? ''
}
/**
diff --git a/apps/files_sharing/src/views/SharingDetailsTab.vue b/apps/files_sharing/src/views/SharingDetailsTab.vue
index 78b0a10c569..5f0519e6c64 100644
--- a/apps/files_sharing/src/views/SharingDetailsTab.vue
+++ b/apps/files_sharing/src/views/SharingDetailsTab.vue
@@ -472,7 +472,7 @@ export default {
return this.share.type === this.SHARE_TYPES.SHARE_TYPE_GROUP
},
isNewShare() {
- return this.share.id === null || this.share.id === undefined
+ return !this.share.id
},
allowsFileDrop() {
if (this.isFolder && this.config.isPublicUploadEnabled) {
@@ -743,13 +743,10 @@ export default {
},
handleShareType() {
- if (this.share.share_type) {
- this.share.type = this.share.share_type
- }
- // shareType 0 (USER_SHARE) would evaluate to zero
- // Hence the use of hasOwnProperty
if ('shareType' in this.share) {
this.share.type = this.share.shareType
+ } else if (this.share.share_type) {
+ this.share.type = this.share.share_type
}
},
handleDefaultPermissions() {
@@ -770,7 +767,7 @@ export default {
this.sharingPermission = 'custom'
this.advancedSectionAccordionExpanded = true
this.setCustomPermissions = true
- } else {
+ } else if (this.share.permissions) {
this.sharingPermission = this.share.permissions.toString()
}
},