Skip to content

[stable5.4] fix(export): keep cells under their headers for empty grid and ranking answers - #4004

Draft
backportbot[bot] wants to merge 1 commit into
stable5.4from
backport/4001/stable5.4
Draft

backportbot[bot] wants to merge 1 commit into
stable5.4from
backport/4001/stable5.4

Conversation

@backportbot

@backportbot backportbot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Backport of #4001

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

Conflict resolution

The automatic backport left out the hunk that writes one empty cell per export column for a grid or ranking that was not answered, because stable5.4 has no answerExportValue() (typed export cells only exist on main). It is added back in the 5.4 form, $row[] = $answer;, so all three cases of #3980 are fixed on 5.4. The [skip ci] line is removed from the commit.

Checked on stable5.4 (Forms 5.4.3, Nextcloud 35): the four new testGetSubmissionsData cases and all of SubmissionServiceTest (102 tests) pass. Without the added hunk, grid-unanswered and ranking-unanswered-before-another-question fail.


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

…g answers

The export writes one column per row of a grid, per row and column of
a number grid and per option of a ranking. Three cases wrote fewer
cells than the header has columns, so every later cell on the line,
including the answers to all following questions, moved left:

- a number grid row left completely empty wrote one cell instead of
  one per column,
- a grid or ranking question left unanswered wrote one cell instead of
  one per export column.

Also, a number grid cell answered with 0 was exported empty, because
empty() treats 0 as missing.

Fixes #3980

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant