nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.24k stars 4.05k forks source link

[Bug]: Default expiration date is not applied #44727

Closed arno4000 closed 6 months ago

arno4000 commented 6 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

When configuring the default expire date of a share under admin settings -> sharing -> set default expiration date and then sharing a file or folder to an email address, the expiration date is not set. When checking the checkbox, set expiration date, the expiration date is set to today + the amount of days that are configured in the settings.

Steps to reproduce

  1. Set the default expiration date under admin settings -> sharing -> set default expiration date
  2. Share a file or a folder to with an email address
  3. The checkbox Set expiration date should be checked, but is not

Expected behavior

The checkbox set expiration date is checked with the correct expiration date

Installation method

Community Docker image

Nextcloud Server version

27

Operating system

None

PHP engine version

None

Web server

Apache (supported)

Database engine version

SQlite

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "upgrade.disable-web": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost:8080"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "sqlite3",
        "version": "27.1.8.1",
        "overwrite.cli.url": "http:\/\/localhost:8080",
        "installed": true,
        "loglevel": 0
    }
}

List of activated Apps

Enabled:
  - activity: 2.19.0
  - circles: 27.0.1
  - cloud_federation_api: 1.10.0
  - comments: 1.17.0
  - contactsinteraction: 1.8.0
  - dashboard: 7.7.0
  - dav: 1.27.0
  - federatedfilesharing: 1.17.0
  - federation: 1.17.0
  - files: 1.22.0
  - files_pdfviewer: 2.8.0
  - files_reminders: 1.0.0
  - files_rightclick: 1.6.0
  - files_sharing: 1.19.0
  - files_trashbin: 1.17.0
  - files_versions: 1.20.0
  - firstrunwizard: 2.16.0
  - logreader: 2.12.0
  - lookup_server_connector: 1.15.0
  - nextcloud_announcements: 1.16.0
  - notifications: 2.15.0
  - oauth2: 1.15.2
  - password_policy: 1.17.0
  - photos: 2.3.0
  - privacy: 1.11.0
  - provisioning_api: 1.17.0
  - recommendations: 1.6.0
  - related_resources: 1.2.0
  - serverinfo: 1.17.0
  - settings: 1.9.0
  - sharebymail: 1.17.0
  - support: 1.10.1
  - survey_client: 1.15.0
  - systemtags: 1.17.0
  - text: 3.8.0
  - theming: 2.2.0
  - twofactor_backupcodes: 1.16.0
  - updatenotification: 1.17.0
  - user_status: 1.7.0
  - viewer: 2.1.0
  - weather_status: 1.7.0
  - workflowengine: 2.9.0
Disabled:
  - admin_audit: 1.17.0
  - bruteforcesettings: 2.7.0
  - encryption: 2.15.0
  - files_external: 1.19.0
  - suspicious_login: 5.0.0
  - twofactor_totp: 9.0.0
  - user_ldap: 1.17.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

No response

DimonW88 commented 6 months ago

helps to change the language to English

arno4000 commented 6 months ago

helps to change the language to English

How do you mean that? I have set up a fresh Nextcloud instance to reproduce this bug, and this instance was in English (default).

DimonW88 commented 6 months ago

I had this problem after updating to 28.0.4 from 26.0.1. And the default language was not English

arno4000 commented 6 months ago

And when you have set the default language to English, it resolved the problem? Because I have set up a fresh Nextcloud instance, which never had any other default language than English.

DimonW88 commented 6 months ago

yes, changing the language helped me solve the problem, try changing the language to any other, it may help

blizzz commented 6 months ago

closing as a duplicate of https://github.com/nextcloud/server/issues/42060

blizzz commented 6 months ago

~closing as a duplicate of #42060~

Sorry, misread, it is slightly different. Anyhow, I cannot reproduce this behavior in current 27. Please correct me if you still do.

arno4000 commented 6 months ago

I can still reproduce the issue with the following steps:

  1. Start a new nextcloud instance with docker run -d -p 8080:80 nextcloud:27.1.7-apache
  2. Create a user and go to admin settings -> sharing and set a default expiration date image
  3. Share a file or a folder to an email address. In nextcloud version 27.1.5, the set expiration date checkbox is checked with an expiration date which is X days in the future (as defined in the settings). image But in nextcloud version 27.1.7 and 27.1.8 the checkbox is not checked by default. When the checkbox is checked manually in 27.1.7 and 27.1.8, the correct expiration date is chosen.
blizzz commented 6 months ago

@arno4000 I can reproduce it on 27.1.8, but not on the current dev branch, i.e. fixed with 27.1.9 next week.