0

Frustratingly the GoogleAppLauncher can't replicate this and the error only occurs on production. Essentially I have a form submitting json to mailchimp. It is erroring at the javascript and I can't work out why. You can see the 500 error if you try to submit the form - https://v-sons.appspot.com/our-underwear/#subscribe

On the server looks to be a Call to undefined function add_theme_support() however the console tells a different story (I don't understand whether the two relate / not).

In my console, the jQuery error references:

xhr.send( ( s.hasContent && s.data ) || null );

However digging deeper it looks to be a problem with the $.ajax anonymous function of this code block that's being submitted:

jQuery.ajax({
    url: action,
    type: 'POST',
    data: $stickyForm.serialize(),
    success: function(data)
    {
      window.location.hash = 'nearly';
      $('#modalOverlay').addClass('nearly').fadeIn();
      $('#stickyEmail').val("");
      $('#nickName').focus();
    }
});

I've tried to cover as much as I can with this, because to be honest I'm not sure where the problem really lies. It'd be really great to get an answer / some help though because I've been bashing keys for hours trying to work this out. The main problem is this isn't a problem on my local server, and I don't know from what end to attack the problem.

//

Update: It has just occurred to me that this error might have been created by issuing the other fix I used on this other related question I asked the community - 500 Error when Migrating Wordpress to Google Cloud

Community
  • 1
  • 1
Rufus Denne
  • 137
  • 3
  • 8
  • Error 500 (Internal **Server** Error) indicates that the problem is likely on the server side, and has nothing to do with `$.ajax` function since the request is successfully being sent and fails after. – Mihail Russu Oct 06 '14 at 23:22
  • Okay this makes sense @Mihail. Where would you consider the problem likely to be then? Something to do with the error in the App Engine log - `Call to undefined function add_theme_support()`? – Rufus Denne Oct 07 '14 at 11:59
  • It looks like you are using PHP which I am not very familiar with, but quick googling shows that `add_theme_support` issues might be related to problems with wordpress themes and them not being installed properly. Anyway, instead of showing JS code here, which is fine, you are better off showing some backend code. – Mihail Russu Oct 07 '14 at 14:17

1 Answers1

0

See AJAX Mailchimp signup form integration which suggests adding dataType: 'json' and setting contentType.

Community
  • 1
  • 1
Dave W. Smith
  • 24,318
  • 4
  • 40
  • 46
  • Thank you for this reference @Dave. I've tried what you suggested but it hasn't worked. I'm actually using a custom subscribe.php script and not going through the usual `list-manage` post. After using this, the signup form does nothing on localhost (used to work without error), but shows the same error on prod. – Rufus Denne Oct 07 '14 at 12:02
  • Hey Dave, I spent yesterday evening getting rid of the buggy scripts and using the answer you outlined here. Before I was using some subscribe.php script that wasn't working brilliantly. Now I've just integrated a form like you suggested and it works without problem! Many thanks! – Rufus Denne Oct 08 '14 at 08:56