Commit Graph
1 Commits
Author SHA1 Message Date
Lauri Ojansivu aacb2fd4d6 Clearing a card title or description can be undone and redone.
Follow-up to PR #6926. Clearing a value is an edit recorded in History,
not a deletion, so Admin Panel / Problems / Delete has no part in it and
the old value stays restorable. collection2's default clean removes ''
from $set and then throws "your modifier is now empty", so:

- History's redo and Restore of a cleared title or description threw,
  while undo worked. applyFieldContent now writes the recorded value back
  exactly (removeEmptyStrings and trimStrings off).
- The card details title and description clear, and the board
  description clear, pass removeEmptyStrings: false.
- REST card PUT always passes removeEmptyStrings: false for title and
  description: a title of only spaces was trimmed to '' and then removed,
  a 500, and the #6877 description clear had no option at all.

tests/emptyStringClearWrites.test.cjs replays undo/redo/Restore through a
collection2-like clean and pins the options at every write;
tests/playwright/specs/card-clear-undo-redo.e2e.js clears in the card
details and over REST, then undoes and redoes.

Thanks to AhmedLukman and xet7 !
2026-11-18 21:39:15 +02:00