• I’m getting the following message at the top of the browser:

    “Warning: Invalid argument supplied for foreach() in /home/site/site.com/wp-content/plugins/aphrodite-support/templates/aphrodite_inst.php on line 109”

    Here is what is on that line 109:
    foreach ($media_request_array as $key => $value) {

    Thank you

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

Viewing 1 replies (of 1 total)
  • I’m not sure what that plugin is so I’ll assume it’s a custom plugin. Otherwise, if it’s a plugin you plan on updating sometime in the future ( which if it’s not a custom one, you want to keep all the things up to date ) you should not mess or change this plugin file.

    This kind of error usually means that the variable passed into the foreach is not an array. Odds are at some point it’s empty. An easy fix for this is to break out of that functionality if the variable is empty or provide some kind of default data to the variable:

    if( ! empty( $media_request_array ) && is_array( $media_request_array ) ) {
    	
    	foreach( $media_request_array as $key => $value ) {
    	
    		/** ... **/
    	
    	}
    	
    }

    – – – – –

    Additionally, you can ignore this error assuming it’s not breaking your website by turning off debugging in the root installation wp-config.php file.

    define( 'WP_DEBUG', false );

Viewing 1 replies (of 1 total)

The topic ‘Error in browser’ is closed to new replies.