Simple Membership Plugin › Forums › Simple Membership Plugin › Warning: Invalid argument supplied for foreach() + Warning: Cannot modify header
This topic contains 3 replies, has 2 voices, and was last updated by mbrsolution 1 week, 2 days ago.
-
AuthorPosts
-
April 8, 2021 at 7:17 am #22431
Every time I change the role and click “save data” in my member directory I’m getting the following error message on a blank screen. The change I made does stick, but I need to know if something is messed up in our installation.
Warning: Invalid argument supplied for foreach() in /home/customer/www/xxx.com/public_html/wp-content/plugins/swpm-form-builder/classes/class.swpm-fb-formmeta.php on line 95 Warning: Cannot modify header information - headers already sent by (output started at /home/customer/www/xxx.com/public_html/wp-content/plugins/swpm-form-builder/classes/class.swpm-fb-formmeta.php:95) in /home/customer/www/xxx.com/public_html/wp-includes/pluggable.php on line 1329
The lines surrounding line 95 were these:
public function load($form_id, $load_fields = true) { global $wpdb; $query = $wpdb->prepare("SELECT form_id AS id, form_key AS _key, form_title AS title, form_type AS type, form_membership_level AS for_level, form_success_type AS success_type, form_success_message AS success_message, form_notification_setting AS notification_setting, form_notification_email_name AS notification_email_name, form_notification_subject AS notification_subject, form_notification_message AS notification_message, form_label_alignment AS label_alignment FROM $this->table WHERE form_id=%d", $form_id); $data = $wpdb->get_row($query); foreach ($data as $key => $value) { if ($key == '_key') { $this->key = $value; continue; } $this->$key = $value; }
Line 95 is this one:
foreach ($data as $key => $value) {
Thank-you so much for your time to take a look at this issue!
April 10, 2021 at 12:23 am #22437Hi, is the above your own custom PHP code?
Thank you
April 12, 2021 at 5:14 am #22440This is the code that should have come with the plugin – it’s in the plugin folder. I didn’t make any changes.
April 12, 2021 at 10:23 am #22442Hi, please carry out the following troubleshooting steps.
Also what PHP version is running in your server?
Thank you
-
AuthorPosts
You must be logged in to reply to this topic.