What change did you make to Flarum to allow empty post content? This should not be allowed by default and I don't see which extension in your list might do that.
The underlying issue is a bit of an unknown behavior situation in Flarum. Flarum does not allow empty content value. But if it receives an empty value, it will set the column to null
. At the same time, the post parser expects all posts of type comment
to have a string content value. Meaning it can never work with empty content, but it's also not allowed so this situation is never encountered.
So whatever code was written to allow an empty body should either force-store the empty content as string, or modify the signature of all extenders and implementations of those extenders in extensions to accept nullable comment content. The latter being nearly impossible, only the first solution is feasible.
I see a lot more code has been rewritten in the upcoming 2.x release to require a string everywhere. Yet the CommentPost
class still saves an empty content to null
in the development branch. This should probably be changed, just for consistency even if Flarum still won't allow empty content by default. Because as we see here, if any null
value ends up in the database (for a comment
post type), it will break a lot of things.
So, the next step to fix the issue on your forum is identifying which extension or local change allows empty post content. The red message should say The content field is required
when you try to post.