Export: an empty row in a number grid shifts all following cells left
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
La lógica de exportación está en lib/Service/SubmissionService.php, en el bucle foreach sobre $gridRowsPerQuestionId[$questionId]; la rama de fila vacía actualmente añade una única columna ''. Comprueba cómo se construye $gridColumnsPerQuestionId para ANSWER_GRID_TYPE_NUMBER y haz que una fila vacía añada una celda en blanco por columna. Cambia también la comprobación inner empty() para que una respuesta de 0 se conserve. Está hecho cuando un grid de tipo number con una fila vacía mantiene alineadas las columnas posteriores y una respuesta de 0 se exporta como 0.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
In the CSV/XLSX export of results, a number grid question whose row is left completely empty shifts every following cell on that line to the left: the next rows' values, and the answers to all later questions, end up under the wrong headers.
Steps to reproduce
- Create a form with one grid question, cell type Number, rows A1, A2, A3 and columns N0, N1, N2. Add a second question of any type after it.
- Submit one response that fills A1 (N0 = 2, N2 = 1) and A3 (N1 = 4), and leaves all of row A2 empty.
- Go to Results and export to CSV or XLSX.
Expected behaviour
The 4 appears under "(A3 - N1)", and the second question's answer appears in its own column.
Actual behaviour
The 4 appears under "(A2 - N2)", and every later cell on that line, including the second question's answer, is shifted left by (number of columns − 1) = 2.
Cause
In lib/Service/SubmissionService.php (the export), a grid row with no answer adds one empty cell:
foreach ($gridRowsPerQuestionId[$questionId] as $row) {
if (empty($answerText[$row])) {
$columns[] = '';
continue;
}
A number grid has one export column per row × column, so for ANSWER_GRID_TYPE_NUMBER an empty row has to add one empty cell per column (count($gridColumnsPerQuestionId[$questionId])). Radio and checkbox grids use one column per row, so they are not affected.
Versions
Seen on Forms 5.4.2; the same code is on main today (checked against v5.4.3 and main).
Related, same block: an answer of 0 exports as an empty cell
For number grids, the inner check if (empty($answerText[$row][$column])) treats an answer of 0 (or "0") as missing, because empty() is true for 0 in PHP, so a cell answered with 0 is exported blank. A check such as !isset($answerText[$row][$column]) || $answerText[$row][$column] === '' keeps the 0. (Found by reading the code, not by running it.)
- Lenguaje dominante
- JavaScript
- Estrellas
- 385
- Forks
- 133
- Merge medio
- 7 h 54 min
- PR fusionados (30 d)
- 157
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nextcloud/forms
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
0. Needs triage bug
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Allow a team to own a formAbierto1. to develop enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
nextcloud/forms#3841 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
0. Needs triage bug
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
nextcloud/forms#3831 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
1. to develop enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
nextcloud/forms#3829 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de nextcloud/forms
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cytoscape/cytoscape.js#3597 ·
Los mantenedores suelen responder en 5 días
-
priority: low server testing
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
blamechris/chroxy#9277 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
sunososobro-hub/cloudball#191 ·
Los mantenedores suelen responder en 1 día
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
microsoft/playwright#44289 ·
Los mantenedores suelen responder en 1 día
-
Wire ISO post: has() accepts text values such as an empty string, true or 0x1A for wire numbersAbiertoarea:post effort:low enhancement P7 source:agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día