[Resolved] bug: comment-form textarea missing required

Home Forums Support [Resolved] bug: comment-form textarea missing required

Home Forums Support bug: comment-form textarea missing required

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1278312
    Adam

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

    #1278496
    Leo
    Staff
    Customer Support

    Hi there,

    Is the aria-required="true" part in line 117 what you are referring to?
    https://github.com/tomusborne/generatepress/blob/master/inc/structure/comments.php#L117

    #1279801
    Adam

    Hi,

    aria is other thing, the “required” attribute is missing. It’s possible to submit comment without comment.

    #1280001
    Tom
    Lead Developer
    Lead Developer

    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 πŸ™‚

    #1280350
    Adam

    Hi Tom,

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

    #1281217
    Tom
    Lead Developer
    Lead Developer

    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.

    #1282042
    Adam

    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.

    #1282807
    Tom
    Lead Developer
    Lead Developer

    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 πŸ™‚

    #1283301
    Adam

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

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.