Fix a bug with setting empty captions for file attachments.

Review Request #13335 — Created Oct. 12, 2023 and submitted — Latest diff uploaded

Information

Review Board
release-6.x

Reviewers

We had a bug with setting empty captions for file attachments. After setting
an empty caption, the published caption (if it exists) would be displayed
instead of the empty caption. This was due to the conditions that we used to
serialize captions for draft file attachments. This change fixes that up, and
adds unit tests for this case. While this was a backend problem, I've also
added a JS test for saving an empty caption just for good measure.

  • Tested setting empty captions on new drafts, new revisions, and published
    file attachments.
  • Ran unit and JS tests.

Commits

Files