• Resolved mb00

    (@mb00)


    A fix is required in omnisend-connect plugin to address warnings for out of bounds array key access observed in PHP error logs, e.g.:

    2022/09/27 13:10:16 [error] 1181#1181: *425 FastCGI sent in stderr: "PHP message: PHP Warning: Undefined array key 0 in <..>/plugins/omnisend-connect/Manager/OmnisendContactResolver.php on line 110 PHP message: PHP Warning: Trying to access array offset on value of type null in <..>/plugins/omnisend-connect/Manager/OmnisendContactResolver.php on line 110"...

    The warning is triggered when API returns empty contacts result (email is not found):

    {"contacts":[],"paging":{"previous":null,"next":null,"offset":0,"limit":100}}

    Proposed fix:

    In omnisend-connect/Manager/OmnisendContactResolver.php, line 110:

    change line from:
    return $response["contacts"][0]["contactID"];

    to:
    return isset( $response["contacts"][0]["contactID"] ) ? $response["contacts"][0]["contactID"] : null;

Viewing 1 replies (of 1 total)
  • Plugin Author Omnisend

    (@omnisend)

    Heck there!
    Thank you for making a post in our support thread!

    This is a great observation! We have pushed your suggestion to the responsible team, they are going to look into it and make the necessary adjustments.

    If you have any questions or need any assistance, do not hesitate to contact our Support Team, we are available 24/7 and can be reached via In-app chat or email at support@omnisend.com.

    Have a great day!

Viewing 1 replies (of 1 total)
  • The topic ‘Code improvements’ is closed to new replies.