nextcloud / nextcloud/deck

Can't archive board via deck API

Open
#3,873 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug feature: api feature: boards
Dominant language
JavaScript
Stars
1.4k
Forks
354
Avg merge
1d 10h
Merged PRs (30d)
43

Description

Describe the bug
I am trying to archive a board using the deck API but no matter how I pass the archived field, I get archived must be a boolean exception. Looking at the source code I see that the input is validated by is_bool($archived) === false (reference) So I am wondering, given that the http request translates everything to string, is there any valid string here? In boards/{board_id}/acl POST API I was able to use 0|1 to disable/enable the sharing (edit/share/manage) so perhaps the input validation of board update should be similar to the sharing API or maybe try to cast the value, e.g.:

filter_var(<api_val>, FILTER_VALIDATE_BOOLEAN);

To Reproduce
Run a curl command on an existing board you wish to archive:

curl -u <user>:<password> PUT -H "OCS-APIRequest: true" -H "Content-Type: application/json" "https://<host>/index.php/apps/deck/api/v1.1/boards/<board_id>?color=<new_board_color>&title=<new_board_title>&archived=True"

Expected behavior
The given board should be archived.

Server details

Operating system:

Web server:
Apache/2.4.53 (Debian) (apache2handler)

Database:
mysql 10.7.3

PHP version:
8.0.18

Nextcloud version: (see Nextcloud admin page)
24.0.0 - 24.0.0.12

Where did you install Nextcloud from:
unknown (Nextcloud container)

Signing status:

No errors have been found.

List of activated apps:

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - admin_audit: 1.14.0
  - approval: 1.0.9
  - calendar: 3.3.2
  - circles: 24.0.0
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contacts: 4.1.1
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - deck: 1.7.1
  - event_update_notification: 1.5.0
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_accesscontrol: 1.14.0
  - files_automatedtagging: 1.14.0
  - files_external: 1.16.1
  - files_markdown: 2.3.6
  - files_mindmap: 0.0.26
  - files_pdfviewer: 2.5.0
  - files_retention: 1.13.1
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - firstrunwizard: 2.13.0
  - groupfolders: 12.0.0
  - impersonate: 1.11.0
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - nextcloud_announcements: 1.13.0
  - notifications: 2.12.0
  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - provisioning_api: 1.14.0
  - quicknotes: 0.8.0
  - recommendations: 1.3.0
  - richdocuments: 6.1.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - socialsharing_email: 2.5.0
  - spreed: 14.0.2
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - tables: 0.1.2
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - twofactor_duo: 0.0.2
  - twofactor_email: 2.4.0
  - twofactor_totp: 6.4.0
  - updatenotification: 1.14.0
  - user_ldap: 1.14.1
  - user_status: 1.4.0
  - viewer: 1.8.0
  - workflow_script: 1.8.0
  - workflowengine: 2.6.0
Disabled:
  - encryption
  - photos: 1.6.0
  - privacy: 1.8.0
  - weather_status: 1.4.0

Nextcloud configuration:

{ 
    "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
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpsecure": "tls",
        "mail_smtpauth": true,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "24.0.0.12",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "overwritehost": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "overwritewebroot": "\/",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "force_language": "***REMOVED SENSITIVE VALUE***",
        "default_locale": "***REMOVED SENSITIVE VALUE***",
        "skeletondirectory": "",
        "lost_password_link": "disabled",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "twofactor_duo": {
            "IKEY": "***REMOVED SENSITIVE VALUE***",
            "SKEY": "***REMOVED SENSITIVE VALUE***",
            "HOST": "***REMOVED SENSITIVE VALUE***",
            "AKEY": "***REMOVED SENSITIVE VALUE***"
        },
        "maintenance": false,
        "log_rotate_size": "10485760",
        "share_folder": "Shared",
        "app_install_overwrite": [
            "workflow_script"
        ]
    }
}

Are you using an external user-backend, if yes which one:
LDAP

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lib/Service/BoardService.php around the archived validation referenced near line 441, then trace the board update API entry point and compare it with the boards/{board_id}/acl POST handling. Done means a curl request using the supported boolean representation archives the board instead of raising the validation exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.