Upcoming cards widget returns no items through the dashboard API

Đang mở Phù hợp với người mới
#8,845 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
api, backend

Hướng nghiên cứu

Theo dõi DeckWidgetUpcoming::getItems() và OverviewService::findUpcomingCards() để xác nhận các kết quả được nhóm đến bộ lọc của tiện ích bảng điều khiển như thế nào. Bắt đầu bằng cách tìm các phương thức đó và kiểm tra các bài kiểm thử hiện có cho thẻ sắp tới hoặc mục tiện ích bảng điều khiển. Hoàn tất khi API bảng điều khiển trả về các thẻ đến hạn trong phản hồi tiện ích như mong đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Describe the bug
The dashboard API always returns an empty list for the "Upcoming cards" widget, whatever cards are due.

DeckWidgetUpcoming::getItems() expects a flat list of cards, but OverviewService::findUpcomingCards() returns them grouped by nodue, overdue, today, tomorrow, nextSevenDays and later. The filter then checks isset($card['duedate']) on each group, which is never true, so everything is dropped.

As a check, I flattened the groups in getItems() with array_merge(...array_values(...)) on the same test instance, and both cards showed up. main has the same code as 1.19.3.

To Reproduce

  1. Create a board with a list and two cards, due in 1 day and in 3 days.
  2. GET /ocs/v2.php/apps/deck/api/v1.0/overview/upcoming with the header OCS-APIRequest: true returns both, under tomorrow and nextSevenDays.
  3. GET /ocs/v2.php/apps/dashboard/api/v1/widget-items?widgets[]=deck with the same header returns {"deck":[]}.

Expected behavior
Step 3 returns the two cards.

Screenshots
n/a

Client details:
n/a, the requests above are plain curl

Server details

Operating system: Debian (Docker image nextcloud:35.0.3-apache)

Web server: Apache

Database: SQLite

PHP version: 8.5.13

Nextcloud version: 35.0.3

Where did you install Nextcloud from: the Docker image, new install

Signing status: not checked, new install

List of activated apps: the default apps and Deck 1.19.3

Nextcloud configuration: the image's defaults

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

Logs
Nextcloud log (data/nextcloud.log)

Not captured, the request answers 200.

Browser log

n/a

Validated and reproduced on that live instance. I first saw it on Deck 1.18.6 with Nextcloud 34.

Assisted by ClaudeCode:claude-opus-5-5

Ngôn ngữ chính
JavaScript
Star
1.4k
Fork
380
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
72

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của nextcloud/deck

Tất cả issue của nextcloud/deck

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.