Skip to:
Content
Pages
Categories
Search
Top
Bottom

Fatal error: Call to undefined method stdClass::save()


  • vahid mohammadi
    Participant

    @wvmohzoibar

    Hi
    I have wordpress network and installed buddypress on the network. my network just has a subdomain. everything was working well but when I was changing some settings in another plugin, I suddenly noticed that my subdomain doesn’t open… so I enabled PHP errors and now I get this error:

    Warning: Creating default object from empty value in /domains/mysite.com/public_html/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php on line 258 Fatal error: Call to undefined method stdClass::save() in /domains/mysite.com/public_html/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php on line 275

Viewing 21 replies - 1 through 21 (of 21 total)

  • r-a-y
    Keymaster

    @r-a-y

    Thanks for the bug report, @wvmohzoibar.

    Before I file a ticket about this, can you tell us how you triggered this bug?

    We do some checks to ensure that the profile group ID is not blank before proceeding, so it would be nice to find out how you are encountering this error:
    https://buddypress.trac.wordpress.org/browser/tags/2.4.0/src/bp-xprofile/bp-xprofile-functions.php?marks=241-244,258#L224

    I was changing some settings in another plugin

    What plugin were you using that caused this bug?


    vahid mohammadi
    Participant

    @wvmohzoibar

    actually I installed two plugins:
    wp super cache
    symple shortcodes by AJ clarke

    but after changing and saving the settings, I checked the subdomain and there were no problem.. and then I don’t remember what actually I did that I encountered this error… the strange part is that my main site doesn’t have any problem but the subdomain shows this error


    rv8820
    Participant

    @rv8820

    I encountered the same problem (Fatal error: Call to undefined method stdClass::save() in …/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php on line 275). I am running Buddy Press in a multisite. It was working fine until I updated the plugin today.


    Sweeny
    Participant

    @sweeny

    Hello,

    I have the same problem installing the WOFFICE-theme (http://themeforest.net/item/woffice-intranetextranet-wordpress-theme/11671924).

    Warning: Creating default object from empty value in C:\xampp\htdocs\home\wp-content\plugins\buddypress\bp-xprofile\bp-xprofile-functions.php on line 258
    Fatal error: Call to undefined method stdClass::save() in C:\xampp\htdocs\home\wp-content\plugins\buddypress\bp-xprofile\bp-xprofile-functions.php on line 275

    Sweeny


    r-a-y
    Keymaster

    @r-a-y

    @rv8820 @sweeny – Can I ask what you are doing to trigger this error?

    We need to be able to duplicate this error before we can fix it.


    Sweeny
    Participant

    @sweeny

    Of course, nothing special. I have installed the woffice theme and activated woffice birtday plugin. After this… The error appeared.


    r-a-y
    Keymaster

    @r-a-y

    @sweeny – WOFFICE is a premium theme that we do not have access to.

    The other replies in the thread mention that they are using multisite. Are you using multisite?


    doubleF
    Participant

    @doublef

    Hi @Sweeny,

    Woffice developer team here !

    Do you have any ticket open here : https://2f.ticksy.com/ ? Please send us some access to your website so our team can figure out what’s going on ๐Ÿ˜‰

    The issues is also present with some other themes but it seems to be caused by the Birthday extension. As we create new Xprofile fields, but if was working fine before 2.4.0 and we can’t reproduce it.

    That’s why we need more details ๐Ÿ™‚

    Thanks @r-a-y btw !

    Cheers

    2F


    r-a-y
    Keymaster

    @r-a-y

    @doublef – It’s probably a problem with the way your team has coded the Birthday plugin.

    Can you post the relevant lines where you are creating the profile fields?


    Sweeny
    Participant

    @sweeny

    @doublef
    Sorry, can’t give access. It’s a local test environment with a WAMPP installation (apachefriends.org). Perhaps it’s a interaction between this environment and Woffice?
    Php 5.6.14, Apache 2.4.4


    @r-a-y

    I didn’t install a multisite.

    The other guys here used different plugins; so it cannot be only a Woffice problem.

    Sweeny


    doubleF
    Participant

    @doublef

    Hi @r-a-y,

    Here is the function :

    function woffice_birthdays_add_field() {
    	
    	if ( bp_is_active( 'xprofile' ) ){
    		global $bp;
    		global $wpdb;
    		// We check for multisite : 
    	    if (is_multisite() && is_main_site()) {
    		    $table_name = $wpdb->base_prefix .'bp_xprofile_fields';
    	    } else {
    	    	$table_name = $wpdb->prefix .'bp_xprofile_fields';
    	    }
    	    $sqlStr = "SELECT <code>id</code> FROM $table_name WHERE <code>name</code> = 'Birthday'";
    	    $field = $wpdb->get_results($sqlStr);
    	    if(count($field) > 0)
    	    {
    	        return;
    	    }
    		xprofile_insert_field(
    	        array (
    	        	'field_group_id'  => 1,
    	            'field_id' => 'woffice_birthday',
    				'can_delete' => true,
    				'type' => 'datebox',
    				'description' => __('We will only use it for the Birthday widget, so we can celebrate everyone\s birthday.','woffice'),
    				'name' => 'Birthday',
    				'field_order'     => 1,
    				'is_required'     => false,
    	        )
    	    );
    	 }
    	 
    }		
    add_action('bp_init', 'woffice_birthdays_add_field');

    I’m able to reproduce it so I’ll try to troubleshoot it now ๐Ÿ˜‰ I keep you updated,

    2F


    doubleF
    Participant

    @doublef

    Hi there,

    Okay the issue is that the field_id parameter has to be an INT and not a string. Otherwise the save() won’t work out…500 error.

    Regarding Woffice buyers, you can turn off the extension for now, the fix will be available in the next 30 minutes ๐Ÿ˜‰

    Thank you @r-a-y !


    r-a-y
    Keymaster

    @r-a-y

    Glad that you found out the problem, @doubleF!


    vahid mohammadi
    Participant

    @wvmohzoibar

    How can we disable birthday extension when we don’t have access to dashboard?


    r-a-y
    Keymaster

    @r-a-y

    How can we disable birthday extension when we donโ€™t have access to dashboard?

    Rename the theme/plugin you are using.

    For the theme, change eg. /wp-content/themes/woffice/ to /wp-content/themes/woffice2/ and reload the frontpage. This should fallback to Twenty Sixteen.

    Then, rename the folder back to the original name.

    If that doesn’t fix the problem, rename the entire /wp-content/plugins/ directory to /wp-content/plugins2/ and reload the frontpage. This will disable all your active plugins, which should allow you to access the dashboard.

    Then, rename the plugins directory back to normal and go to the Plugins admin page to reactivate the plugins manually.


    cassionunes
    Participant

    @cassionunes

    Hello guys.. I didnยดt get it. If I am correct.. we just identified the bug but its fix arenยดt available yet. Is it correct?

    If not.. please could you give me details how to fix.. I mean.. I got the explanation to disable the plugin.. Do I need to do some thing more to fix and use the woffice theme?


    doubleF
    Participant

    @doublef

    Hi @cassionunes,

    It’s fixed, and the updated version is available here (https://woffice.io/updater/) or on Themeforest since yesterday ๐Ÿ˜‰

    Feel free to open a ticket if you need more details.


    @wvmohzoibar
    : I’ve replied on your ticket

    Best regards

    2F


    ShaneValiant
    Participant

    @shanevaliant-1

    Hi @doublef

    I have been experiencing this issue as well. Just noticed today. I have updated to 1.5.1 but the issue still exists for me. I am still unable to access the subsite in which woffice lives.

    Can you give us a hand?

    Another note I would make: wpoffice is on a subsite and yesterday we went from development site to live environment which came with URL changes via search arn replace for all possible parameters. Not sure if that helps or not, but felt it may play a role.

    Kindest,
    Shane


    ShaneValiant
    Participant

    @shanevaliant-1

    @doublef

    Here is the latest error log:

    PHP message: WordPress database error Table ‘mysitename.wp_16_bp_xprofile_groups’ doesn’t exist for query SELECT DISTINCT g.id FROM wp_16_bp_xprofile_groups g WHERE g.id = 0 ORDER BY g.group_order ASC made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), call_user_func_array, bp_init, do_action(‘bp_init’), call_user_func_array, woffice_social_fields, xprofile_insert_field_group, BP_XProfile_Group->__construct, BP_XProfile_Group->populate, BP_XProfile_Group::get
    PHP message: WordPress database error Table ‘mysitename.wp_16_bp_xprofile_groups’ doesn’t exist for query INSERT INTO wp_16_bp_xprofile_groups (name, description, can_delete) VALUES (‘Social’, ”, 1) made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), call_user_func_array, bp_init, do_action(‘bp_init’), call_user_func_array, woffice_social_fields, xprofile_insert_field_group, BP_XProfile_Group->save
    PHP message: WordPress database error Table ‘mysitename.wp_16_bp_xprofile_groups’ doesn’t exist for query SELECT * FROM wp_16_bp_xprofile_groups WHERE name = ‘CoverOptions’; made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘init’), call_user_func_array, bp_init, do_action(‘bp_init’), call_user_func_array, woffice_cover_add_field
    PHP message: WordPress database error Table ‘mysitename


    ShaneValiant
    Participant

    @shanevaliant-1

    Also we had not activated the birthday plugin from Unyson.

    SIDE NOTE: please think about moving away from UNYSON. It causes so many headaches for multisite. Themefuse is great and I actually purchased there first ever theme, and many more thereafter but it is no good for Woffice. I use nothing pertaining to Unyson with the Woffice theme EXCEPT projects…and thats only because we have to or else it does not load the AWESOME projects integration we are using. ๐Ÿ˜‰ (using the post type ‘project’ is a bad idea as it conflicts with similar project management plugins) Please discontinue Unyson! VC will suffice. Just my 2 cents that I have been wanting to comment on yet haven’t. Keep up the great work..regardless!

    Kindest,
    Shane


    doubleF
    Participant

    @doublef

    Hi Shane,

    Please can you open a ticket here : http://2f.ticksy.com/

    Let me know the ticket’s ID by email at contact[at]alka-web.com so I can assign the ticket to myself. I’ll be there to help tonight ! ๐Ÿ˜‰

    Keep me updated,

    2F

Viewing 21 replies - 1 through 21 (of 21 total)
  • The topic ‘Fatal error: Call to undefined method stdClass::save()’ is closed to new replies.
Skip to toolbar