Invalid argument supplied for foreach()
-
With the latest version of WP-CRM I get ~30 lines repeated at the top of the “All People” page that say:
Warning: Invalid argument supplied for foreach() in /var/www/com.example/www/html/wp-content/plugins/wp-crm/lib/class_default_api.php on line 387
Existing code:
if ( $default_values ) { foreach ($default_values as $default_value) { $user_data[$key]['default'][] = $default_value; } }
Fixed code, using
is_array()
on$default_values
:if ( is_array( $default_values ) ) { foreach ($default_values as $default_value) { $user_data[$key]['default'][] = $default_value; } }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Invalid argument supplied for foreach()’ is closed to new replies.