mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Merge pull request #52072 from nextcloud/fix/sharing-exp-date
This commit is contained in:
commit
f4841e1172
12 changed files with 55 additions and 13 deletions
|
|
@ -296,8 +296,8 @@ export default defineComponent({
|
|||
path: this.destination,
|
||||
note: this.note,
|
||||
|
||||
password: this.password || undefined,
|
||||
expireDate: expireDate || undefined,
|
||||
password: this.password || '',
|
||||
expireDate: expireDate || '',
|
||||
|
||||
// Empty string
|
||||
shareWith: '',
|
||||
|
|
|
|||
|
|
@ -54,8 +54,12 @@ trait Sharing {
|
|||
$fd = $body->getRowsHash();
|
||||
if (array_key_exists('expireDate', $fd)) {
|
||||
$dateModification = $fd['expireDate'];
|
||||
if (!empty($dateModification)) {
|
||||
if ($dateModification === 'null') {
|
||||
$fd['expireDate'] = null;
|
||||
} elseif (!empty($dateModification)) {
|
||||
$fd['expireDate'] = date('Y-m-d', strtotime($dateModification));
|
||||
} else {
|
||||
$fd['expireDate'] = '';
|
||||
}
|
||||
}
|
||||
$options['form_params'] = $fd;
|
||||
|
|
|
|||
|
|
@ -231,10 +231,11 @@ Feature: sharing
|
|||
| url | AN_URL |
|
||||
| mimetype | httpd/unix-directory |
|
||||
|
||||
Scenario: Creating a new share with expiration date removed, when default expiration is set
|
||||
Scenario: Creating a new share with expiration date empty, when default expiration is set
|
||||
Given user "user0" exists
|
||||
And user "user1" exists
|
||||
And parameter "shareapi_default_expire_date" of app "core" is set to "yes"
|
||||
And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes"
|
||||
And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3"
|
||||
And As an "user0"
|
||||
When creating a share with
|
||||
| path | welcome.txt |
|
||||
|
|
@ -249,6 +250,43 @@ Feature: sharing
|
|||
And Share fields of last share match with
|
||||
| expiration ||
|
||||
|
||||
Scenario: Creating a new share with expiration date removed, when default expiration is set
|
||||
Given user "user0" exists
|
||||
And user "user1" exists
|
||||
And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes"
|
||||
And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3"
|
||||
And As an "user0"
|
||||
When creating a share with
|
||||
| path | welcome.txt |
|
||||
| shareWith | user1 |
|
||||
| shareType | 0 |
|
||||
Then the OCS status code should be "100"
|
||||
And the HTTP status code should be "200"
|
||||
And Getting info of last share
|
||||
Then the OCS status code should be "100"
|
||||
And the HTTP status code should be "200"
|
||||
And Share fields of last share match with
|
||||
| expiration | +3 days |
|
||||
|
||||
Scenario: Creating a new share with expiration date null, when default expiration is set
|
||||
Given user "user0" exists
|
||||
And user "user1" exists
|
||||
And parameter "shareapi_default_internal_expire_date" of app "core" is set to "yes"
|
||||
And parameter "shareapi_internal_expire_after_n_days" of app "core" is set to "3"
|
||||
And As an "user0"
|
||||
When creating a share with
|
||||
| path | welcome.txt |
|
||||
| shareWith | user1 |
|
||||
| shareType | 0 |
|
||||
| expireDate | null |
|
||||
Then the OCS status code should be "100"
|
||||
And the HTTP status code should be "200"
|
||||
And Getting info of last share
|
||||
Then the OCS status code should be "100"
|
||||
And the HTTP status code should be "200"
|
||||
And Share fields of last share match with
|
||||
| expiration | +3 days |
|
||||
|
||||
Scenario: Creating a new public share, updating its password and getting its info
|
||||
Given user "user0" exists
|
||||
And As an "user0"
|
||||
|
|
|
|||
1
dist/3456-3456.js.map
vendored
1
dist/3456-3456.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/3456-3456.js.map.license
vendored
1
dist/3456-3456.js.map.license
vendored
|
|
@ -1 +0,0 @@
|
|||
3456-3456.js.license
|
||||
4
dist/3456-3456.js → dist/4039-4039.js
vendored
4
dist/3456-3456.js → dist/4039-4039.js
vendored
File diff suppressed because one or more lines are too long
1
dist/4039-4039.js.map
vendored
Normal file
1
dist/4039-4039.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/4039-4039.js.map.license
vendored
Symbolic link
1
dist/4039-4039.js.map.license
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
4039-4039.js.license
|
||||
4
dist/files_sharing-init.js
vendored
4
dist/files_sharing-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_sharing-init.js.map
vendored
2
dist/files_sharing-init.js.map
vendored
File diff suppressed because one or more lines are too long
|
|
@ -379,7 +379,7 @@ interface IShare {
|
|||
public function getExpirationDate();
|
||||
|
||||
/**
|
||||
* Set overwrite flag for falsy expiry date vavlues
|
||||
* Set overwrite flag for falsy expiry date values
|
||||
*
|
||||
* @param bool $noExpirationDate
|
||||
* @return \OCP\Share\IShare The modified object
|
||||
|
|
|
|||
Loading…
Reference in a new issue