nextcloud / nextcloud/tables

Inline editing of a "Short text" (TextLine) cell crashes with a JS error

Open
#3,012 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
JavaScript
Stars
214
Forks
52
Avg merge
1d 10h
Merged PRs (30d)
82

Description

Steps to reproduce
  1. Use a table that was originally created under Nextcloud 32.x with an older version of the Tables app, and has since been migrated by upgrading to Nextcloud 34.0.4 / Tables 2.3.1.
  2. Pick a row in that table where no cell has ever been edited/saved since the migration (all cells empty/untouched).
  3. Click directly on a "Short text" (TextLine) column cell in that row to start inline editing.
  4. Observe the JS error in the browser console and that the input field does not appear / editing does not start.
  5. As a control: open the same row via the row edit modal, save any single value, close the modal. Inline editing on the other cells of that row now works without error.
  6. As another control: on the same untouched legacy row, inline-editing a "Date and time" column (entering only a time value) works without error.
Expected behavior

Inline editing should work the same way for legacy rows as for rows created under the current app version, regardless of whether any cell in the row has previously been saved.

Actual behavior

Inline editing of a "Short text" (TextLine) cell crashes with a JS error when the row being edited originates from a table that was created under an older Nextcloud/Tables version (Nextcloud 32.x) and has since been migrated to the current database structure. Editing via the row's full edit modal (pencil/fullscreen icon) works fine in all cases.

The crash only occurs on rows that have never had any cell value saved since the migration. As soon as any single cell in the affected row has been saved once (via the edit modal), inline editing starts working for the other cells in that same row as well. A "Date and time" column containing only a time value does not trigger the crash, even on an otherwise completely untouched legacy row — the issue appears specific to the TextLine cell type.

This strongly suggests that legacy rows are missing an expected cell record (created before the app's database structure migration, e.g. around Tables 0.7/0.8, where "New database structure" changes were introduced), and that the current frontend code assumes such a record always exists when initializing the inline editor.

Tables app version

2.3.1

Browser

Firefox 128, Edge 153

Client operating system

Windows

Operating system

Debian 13

Web server

Apache

PHP engine version

PHP 8.3

Database

MariaDB

Additional info
  • Editing the same cell via the row's edit modal works without any error.
  • This appears related to legacy rows predating the app's database structure migration (row/cell schema change referenced in past issues such as the "New database structure" migration around Tables 0.7/0.8). It's possible that such legacy rows are missing a cell record for columns that were never explicitly saved, and that cellEditMixin.js assumes this record always exists when starting inline editing.
  • Tables created natively under the current app version do not seem to be affected (no crash observed on entirely new/empty rows there — only reproducible on rows carried over from the Nextcloud 32.x / older Tables era).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cellEditMixin.js, focusing on inline editing initialization for Short text cells when a migrated row has no saved cell record. Reproduce with an untouched legacy row from the described Nextcloud 32.x migration and compare it with a row saved through the edit modal and with Date and time editing. Done means inline editing starts without a JavaScript error for those legacy rows.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.