• Resolved joshcummingsdesign

    (@joshcummingsdesign)


    Hello,

    We are running EDD Helpscout version 2.1 and we are getting the following warning in Sentry:

    Warning: Invalid argument supplied for foreach()

    /wp-content/plugins/edd-helpscout/includes/class-endpoint.php in EDD\HelpScout\Endpoint::get_edd_customers at line 134

    This happens when a POST request is made to /edd-helpscout-api/customer_info

    Thank you for your help.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Thomas Maier

    (@webzunft)

    Hi joshcummingsdesign,

    thanks for reaching out.

    All three errors you reported indicate, that customer emails are missing.

    The plugin should not even come to the position in the code when there is no email found, so I am a bit clueless. We are running EDD Help Scout on our site with a lot of requests and never saw that error.

    Does the App in Help Scout work and returns client data or is that completely broken?

    Are you using any filters from the plugin, like edd_helpscout_customer_emails?

    Are you using the latest versions of all EDD plugins?

    Thanks,
    Thomas

    Thread Starter joshcummingsdesign

    (@joshcummingsdesign)

    Hello Thomas,

    Thanks for your quick reply. We are seeing the customer data in the body of the request from Help Scout. Some of the requests, however, are missing the email address in the POST body. They all have the customer ID.

    It seems as though it’s possible for Help Scout to not send the email in the POST body. Is this normal? If so, there should be a check for that somewhere to prevent this exception from being thrown.

    Thank you,
    Josh

    Plugin Author Thomas Maier

    (@webzunft)

    Hi Josh,

    thanks for your reply.

    > Is this normal?

    I don’t know. It doesn’t happen on our installation. Help Scout’s documentation is missing a few information on when certain fields are used.

    I created an untested version with a potential fix. You can download it here. As I said, untested, since I cannot reproduce the error message.
    If you are curious, you find the changes here.

    Let me know if this works
    Thomas

    Thread Starter joshcummingsdesign

    (@joshcummingsdesign)

    Hi Thomas,

    Thanks. I’ll test these changes out and report back once I’ve had some time to test them. Thank you so much!

    – Josh

    Thread Starter joshcummingsdesign

    (@joshcummingsdesign)

    Hi Thomas,

    Since using the updated version you provided, we have not seen this error. I think it is safe to merge this change.

    Thanks, and all the best.

    – Josh

    Plugin Author Thomas Maier

    (@webzunft)

    Hi Josh, thanks for letting me know. I will prepare that code for the next update then.

    Thomas

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Warning: Invalid argument supplied for foreach()’ is closed to new replies.