Export to linked file fails with "Invalid column index 16385" after the file was edited in an office suite

Đang mở
#3,831 1 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
backend

Hướng nghiên cứu

Start in SubmissionService::exportData, where the existing linked spreadsheet is loaded and its columns and rows are synced, and follow the calls to getHighestColumn() and removeColumnByIndex. SyncSubmissionsWithLinkedFileJob hits the same path in the background. Reproduce by loading a spreadsheet whose row 2 has styled cells out to column XFD and checking which column index is passed in. Done means the export either succeeds on that file or stops with a clear error, and the maintainers still need to pick between those two behaviours.

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

Mô tả

0. Needs triage bug

Exporting submissions into an existing (linked) spreadsheet fails once that file has been opened and saved in an office suite (Collabora/Nextcloud Office). The UI shows "Error while exporting to Files" and the log contains:

PhpOffice\PhpSpreadsheet\Exception: Invalid column index 16385
Since 5.4.0 the export loads the existing file and syncs columns/rows into it (SubmissionService::exportData). After saving in an office suite, row-level formatting (e.g. on the hidden ID row 2) makes getHighestColumn() return the last possible column (XFD = 16384). The column sync (removeColumnByIndex / writing the header) then addresses column 16385, which PhpSpreadsheet rejects.

Steps to reproduce
Create a form, add a submission.
Results → "Export to Files" (xlsx), so the form gets a linked file.
Open the exported xlsx in Nextcloud Office (Collabora), change nothing or format a cell, save.
Add another submission, or export to Files again.
Export fails; the background sync (SyncSubmissionsWithLinkedFileJob) fails the same way.
Expected behavior
The export either works on a file edited in an office suite (e.g. by using getHighestDataColumn() instead of getHighestColumn() and ignoring styled-but-empty cells), or fails with a clear message such as "The linked file was changed outside Forms – please unlink or rename it".

Workaround
Rename or move the edited file and unlink it, then export again (a fresh file is created).

Environment
Forms 5.4.0 (code path unchanged in 5.4.1 and main as of 2026-11-03)
Nextcloud 34.0.5, Docker image nextcloud:34.0.5-apache
Office: Collabora Online (richdocuments 11.1.2)

Ngôn ngữ chính
JavaScript
Star
385
Fork
133
Merge trung bình
7 giờ 54 phút
Pull request đã merge (30 ngày)
157

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/forms

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

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.