• Resolved michaelw_dc

    (@michaelw_dc)


    Recently, when attempting to add a new feed, I’ve found that an error is preventing the list selection from appearing.

    Warning: array_merge(): Argument #2 is not an array in /PATHING-REDACTED/wp-content/plugins/gravity-forms-constant-contact/api/cc_class.php on line 181
    Could not load Constant Contact contact lists.
    Error:

    I found that this is due to line 148 of api/cc_class.php, where the parsedReturn variable type and presence of content is checked. If there is no data returned, or if its not in the correct format, false is returned.

    If this is a recursive call, an array_merge of mailLists and the results of the recursive call is returned. Because false is not an array, array_merge throws an exception.
    ____

    To fix this, I updated line 148 of api/cc_class.php to return an empty array, instead of false. Not certain if this will have other implications. If there is another place in the code that relies on false if something is wrong, then I’ve caused a potential problem.

The topic ‘Potential solution to array_merge error when creating a new feed’ is closed to new replies.