Support » Plugin: Akismet Spam Protection » v4.1.8 breaks comment form

  • Resolved tyler0001

    (@tyler0001)


    If a form is customized in any way, the new update will break forms with the error “All fields are required”.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Christopher Finke

    (@cfinke)

    Can you give me an example of a form that this is happening to?

    Plugin Author Christopher Finke

    (@cfinke)

    Or how the form was customized?

    Thread Starter tyler0001

    (@tyler0001)

    I cannot provide an example right now because I reverted the update.

    My hunch is that it is this commit: https://plugins.trac.wordpress.org/changeset/2434713/akismet

    Looks like “All fields are required” is a generic error for my site passed into wp_localize_script when loading the JS.

    I’m testing locally and will post updates here.

    Plugin Author Christopher Finke

    (@cfinke)

    What are you using to require that all fields are filled in? Is it a custom plugin you wrote, a plugin from wordpress.org, or something in your theme?

    Thread Starter tyler0001

    (@tyler0001)

    Not the most elegant code.. but this is from my theme and validates the comment form:

        $form.find('input:not([type="file"]),textarea').each(function () {
          if (!$(this).val()) {
            valid = false;
          }
        });
    
        // if invalid, show the "all field required" warning
    

    It looks like the update added a honeypot? with the extra textarea ak_hp_textarea. At any rate, refactoring the JS will fix this. Thanks for the quick reply.

    Plugin Author Christopher Finke

    (@cfinke)

    Yeah, I agree with your assessment. If this proves to be an issue with more people, we might have to look at giving the Akismet textarea a default value, but thanks for the heads up about it.

    Plugin Author Christopher Finke

    (@cfinke)

    The simplest fix would probably be to add :visible to the selector, so you’re only checking if visible form fields have been filled in.

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