Support » Plugin: Constant Contact Forms » Invalid argument on line 1087

  • My PHP error logs are rife with this report:

    PHP Warning: Invalid argument supplied for foreach() in /srv/htdocs/wp-content/plugins/constant-contact-forms/includes/class-settings.php on line 1087

    Plugin v1.12.0, WordPress 5.9

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Constant Contact

    (@constantcontact)

    Hi @kgagne

    Definitely something we’ll want to get taken care of for the logging aspect of it.

    One immediate question I have is if your connected account has any lists presently created for it, or is it just empty at the moment. Perhaps early on in the planning.

    Thread Starter kgagne

    (@kgagne)

    Thank you for the speedy response! 😲 The Constant Contact account has 35 lists, all of which are displayed under the “Add subscribers to” section of the /wp-admin/edit.php?post_type=ctct_forms&page=ctct_options_settings_general page. I have one list checked.

    Plugin Author Constant Contact

    (@constantcontact)

    Hmm.

    Good to know you have lists and whatnot, hopefully full with signups as well.

    How recent are these errors? Are they all new and still populating?

    Also if needed, how willing would you be to edit one small spot of code to see if that solves the logging issue, if the log entries are still really recent.

    Thread Starter kgagne

    (@kgagne)

    The errors are still occurring and have been occurring for several weeks; I’ve just been delayed in reporting them. 😬

    The output of wp php-errors indicates the error is happening once every 1–3 seconds.

    I have a dev environment in which I can try editing the plugin code, so feel free to be creative in whatever options you’d like me to try. πŸ˜‡

    Plugin Author Constant Contact

    (@constantcontact)

    In the /includes/class-settings.php file in the plugin code, on line 1084, change this:

    $lists = constant_contact_get_option( '_ctct_optin_list', '' );
    

    to

    $lists = constant_contact_get_option( '_ctct_optin_list', [] );
    

    This will make this function call default to an empty array, instead of a string, which should resolve the original issue at hand about invalid arguments.

    Is there any noticeable other issues with the website? or has it been performing like expected otherwise, including getting contacts successfully added to the lists in question?

    Thread Starter kgagne

    (@kgagne)

    Thanks! I made this edit, ran wp cache flush, waited a few minutes, then ran wp php-errors. Alas, the original error is still occurring. πŸ™

    Everything else seems to be working fine β€” new subscribers continue to get added to the list.

    Plugin Author Constant Contact

    (@constantcontact)

    Hmm. Same line numbers and everything? Not familiar with wp php-errors, though I’m aware of WP-CLI in general. Must be a hosting-provided command?

    Good to know everything else is still going well regarding signups and whatnot.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.