Upload attachment to comment gives 500 error when comment text is empty in first attempt

Created on 14 October 2019, about 5 years ago
Updated 3 March 2023, over 1 year ago

Problem/Motivation

When you attach an attachment to a comment and leave the comment text empty and then enter the comment text again and re-submit... you will receive a 500 error. "[{"command":"insert","method":"prepend","selector":null,"data":"\u003Cdiv class=\u0022alert alert-danger alert-dismissible card-radius\u0022 role=\u0022alert\u0022\u003E\n \u003Ca href=\u0022#\u0022 role=\u0022button\u0022 class=\u0022close\u0022 data-dismiss=\u0022alert\u0022 aria-label=\u0022Close\u0022\u003E\u003Cspan aria-hidden=\u0022true\u0022\u003E\u0026times;\u003C\/span\u003E\u003C\/a\u003E\n \u003Ch4 class=\u0022sr-only\u0022\u003EError message\u003C\/h4\u003E\n An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (64 MB) that this server supports.\n \u003C\/div\u003E\n","settings":null}]"

But the comment is added successfully.

Just to be clear, this only happens when you leave the comment text field empty the first time and you receive a form validation error.

I've marked it as minor as it only happens when you have the validation error and the comment is still added successfully.

Proposed resolution

Debug and solve the issue.

🐛 Bug report
Status

Active

Version

11.7

Component

Code (back-end)

Created by

🇳🇱Netherlands jaapjan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024