Got "Invalid argument supplied for foreach()"

I upgraded to version last night from I immediately started getting this error message:

Invalid argument supplied for foreach() in [site directory]/wp-content/plugins/popover/inc/class-popup-base.php on line 636

I looked at the code, and a couple of interesting things.

1) The comment for this section of code states: * @since, but this is only version
2) The error is happening on a statement that is evaluating an array that is created immediately before this with an apply_filters() function that I believe is grabbing a list of the currently activated popups for the site. Since we are currently NOT running any active popups (my client just had an event last week and nothing queued up yet for the next event), this statement is likely not bringing back any results, which I confirmed by adding an var_export of the array which showed it to be "NULL". It's understandable then why the foreach() statement is getting an error.

I've added an if statement around the foreach():

+636: if (! $popup_ids == NULL) {
+654: }

I would appreciate having this addressed somehow soon.

Thank you for all of your help!


Art Smith
Ambrosia Web Technology

  • Patrick

    Hey there @Ambrosia Web Technology

    I hope you had a great weekend!

    I just tried to reproduce that error message on my own site by first installing version, then updating to, but got no messages at all. There are no popups on my test site either.

    However, I notice in the plugin code that there are actually half a dozen instances of functions & filters commented as since

    I've notified the plugin developer of this situation so he can investigate and apply fixes to any troublesome areas like the one you reported here.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.