WordPress.org

Forums

MailChimp Widget
[resolved] After second wrong email submit it gets stuck (5 posts)

  1. Jan Zikmund
    Member
    Posted 3 years ago #

    Hello,

    today I installed your plugin and I experienced a strange behavior, when I enter incorrect email twice. If I enter 'aaa' as email and submit, I correctly get error message. But when I enter it again and submit, I just get a neverending loader. I was debugging the mailchimp-widget.js and found the problem on the very last lines - there is a condition, that if there is no error container, it is correctly created. But if it is already there, nothing happens.. while instead the loader should be hidden and fields shown again.

    Here is the part of code that is in plugin and didn't work for me:

    if (0 === error_container.length) {
      ajax_loader.remove();
      eL.children().show();
      error_container = jQuery('<div class="error"></div>');
      error_container.prependTo(eL);
    }
    error_container.html(data.error);

    Here is how I changed it to be correct (and so it works for me):

    if (0 === error_container.length) {
      ajax_loader.remove();
      eL.children().show();
      error_container = jQuery('<div class="error"></div>');
      error_container.prependTo(eL);
    } else {
      ajax_loader.remove();
      eL.children().show();
    }
    error_container.html(data.error);

    I was just wondering - is this a bug and I am the only one experiencing this, or am I missing something ?

    Thank you

    http://wordpress.org/extend/plugins/mailchimp-widget/

  2. jameslafferty
    Member
    Plugin Author

    Posted 3 years ago #

    This is a bug, verify. I'll try and get a quick fix into the code and committed later today. Thanks for catching it!

  3. Jan Zikmund
    Member
    Posted 3 years ago #

    Thanks for fast reply. Please just write here when it is fixed so I can mark this [resolved] and update it on my site.

  4. jameslafferty
    Member
    Plugin Author

    Posted 3 years ago #

    Just committed your fix, which seems to be working well where I've tested it. Thanks so much!

  5. Jan Zikmund
    Member
    Posted 3 years ago #

    You're welcome, thanks also for a quick fix and good communication ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • MailChimp Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic