WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Call to a member function get() on a non-object in query.php on line 27 (11 posts)

  1. Nostalgeek
    Member
    Posted 2 years ago #

    Hello,

    I've upgraded wp-events from 5.0.42 to 5.1.6 and I am getting the following error:

    Fatal error: Call to a member function get() on a non-object in /homez.532/nosta/www/wp-includes/query.php on line 27

    The error only appears when I enable a themeforest theme (goodminimal). I contacted the author but he wasn't able to help.

    Line 27 is the first function in the file:

    function get_query_var($var) {
    global $wp_query;
    return $wp_query->get($var);
    }

    Should this help, I just tried to install all versions in between 5.0.42 and 5.1.6, and the error appears starting version 5.1.4.

    Does anyone know what could cause this starting version 5.1.4? The website is not live yet so I can provide access if needed.

    Best regards,

    Michael

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

    can you try to turn-on WP_DEBUG to see if there's any other error?

  3. Nostalgeek
    Member
    Posted 2 years ago #

    These are the notifications I get in addition now on the homepage :

    Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /homez.532/reebokcr/www/wp-includes/functions.php on line 3587

    Notice: add_option was called with an argument that is deprecated since version 2.3 with no alternative available. in /homez.532/reebokcr/www/wp-includes/functions.php on line 3553

    In the admin panel I get the same add_option error and this error in addition :

    Notice: Undefined index: page in /homez.532/reebokcr/www/wp-content/themes/good-minimal/functions.php on line 533

    Hope this will give you a good hint... Thanks already !

  4. agelonwl
    Member
    Posted 2 years ago #

    can I know whats on this line? also, do you have a sample link?

    Notice: Undefined index: page in /homez.532/reebokcr/www/wp-content/themes/good-minimal/functions.php on line 533

  5. Nostalgeek
    Member
    Posted 2 years ago #

    Sure, I've set up a test env on another server where i can give access if needed - http://nosta.net/TEST/

    Line 533 is :
    if ( $_GET['page'] == basename(__FILE__) ) {

    It's part of a function :

    function mytheme_add_admin() {
    
        global $themename, $shortname, $options;
    
        if ( $_GET['page'] == basename(__FILE__) ) {
    
            if ( 'save' == $_REQUEST['action'] ) {
  6. Nostalgeek
    Member
    Posted 2 years ago #

    This is another error on the events pages:

    Notice: Undefined index: current_sidebar in /homez.41/nosta4/www/TEST/wp-content/themes/good-minimal/page.php on line 37

    <?php
    				wp_reset_query();
    				$custom = get_post_custom($post->ID);
    				$current_sidebar = $custom["current_sidebar"][0];	// LINE 37
    
    				if ($current_sidebar) {
    					if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar($current_sidebar) ) :
    					endif;
    				}
    			?>
  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    your theme should be doing this

    if ( !empty($_GET['page']) && $_GET['page'] == basename(__FILE__) ) {

  8. Nostalgeek
    Member
    Posted 2 years ago #

    Thanks Marcus, this solved one of the errors that appeared in the admin panel after I enabled debug_mode.

    However the other ones are still there, especially the original error I posted that I get on the main page, is still there. That one really breaks the page, as the others aren't showed without debug mode.

  9. reflectiondigital
    Member
    Posted 2 years ago #

    I had the same error on upgrading using a custom theme. Try commenting out those lines - depending on what that function does for your theme you may have to code it in a different way...

  10. Nostalgeek
    Member
    Posted 2 years ago #

    I don't really know where to look, only that it might be a problem with the slider?

    It's strange that the error points to the first function in query.php, wouldn't it be a problem with any function in that file too?

    Fatal error: Call to a member function get() on a non-object in /homez.532/nosta/www/wp-includes/query.php on line 27

    Anyways I guess I'll keep using version 5.1.3 for now unless a miracle happens :). Hopefully the problem will disappear again in a later version.

    Thx for the help and tips.

  11. Nostalgeek
    Member
    Posted 2 years ago #

    I've upgraded to 5.1.7 and the error is gone again... weird. I would like to understand, so if anyone had an explanation i'd love to hear.

    Curious if it will still work with the next update :).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic