Site logo

Archived topic

bug: comment-form textarea missing required

8 replies · Started by Adam on May 10, 2020

Viewing posts 1–9 of 9

In generatepress/inc/structure/comments.php line 116, the required attribute is missing.

Hi,

aria is other thing, the "required" attribute is missing. It's possible to submit comment without comment.

Hi there,

WordPress itself should prevent empty comments (I just tested it).

However, it certainly doesn't hurt to add the tag to the element - done in the next version :)

Hi Tom,

yes it does, but Generatepress overrides filter comment_form_defaults and allows that to happen.

Any chance you can send me a link to check out? Can't get it to happen on my end.

The "required" attribute is just on the browser side of things - WordPress itself should prevent empty comments on the server-side.

The simpliest way to replicate it is on fresh install, login as an admin > go to the post page > submit empty comment.

The other way is to use my link and type empty comment there.

The back end will figure out the comment was empty and it will redirect to the empty page with just message "Error: Please type a comment." and link back - bad user experience.

Ah yes - that's what I see as well. So it does prevent the comment, but you're not wrong, not the best user experience.

I've added the requested attribute to the comment field in the next version :)

Thanks! Yes, it was there initially (comment-template.php:2389) but was hit by the filter ;-)

This archived topic is closed to new replies.