Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

[Support request] Warning: Invalid argument supplied for foreach() + Warning: Cannot modify header

by

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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • April 8, 2021 at 7:17 am #22431

    mwhitham
    Participant

    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 #22437

    mbrsolution
    Moderator

    Hi, is the above your own custom PHP code?

    Thank you

    April 12, 2021 at 5:14 am #22440

    mwhitham
    Participant

    This 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 #22442

    mbrsolution
    Moderator

    Hi, please carry out the following troubleshooting steps.

    https://simple-membership-plugin.com/forums/topic/test-for-plugin-and-theme-conflict-before-posting-an-issue-or-a-bug/

    Also what PHP version is running in your server?

    Thank you

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Please read this message before you start using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Copyright © 2021 | Simple Membership Plugin | Privacy Policy