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

Offen
#3,831 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
45/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
php
Bereich
backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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)

Vorherrschende Sprache
JavaScript
Sterne
385
Forks
133
Ø Merge
7 Std. 54 Min.
Gemergte PRs (30 T.)
157

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nextcloud/forms

Alle Issues in nextcloud/forms

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.