[Plugin: Events Manager] crashes \includes\query.php get non object
-
Hi. After installing 5.1.4 of Events Manager, received the following error:
Call to a member function get() on a non-object in [website]/wp-includes/query.php on line 27
Could not access dashboard, website, etc. Had to rename \content\plugins\events-manager to restore WP GUI. Tried reactivating but error returned, so am replacing with another plugin. Hopefully issues with events manager will be resolved. I enjoyed it when it worked.
-
Can I get more info. on your wp installation? e.g. theme, plugins, buddypress or multisite?
Hi,
I have the same problem. If I activate the Event Manager plugin, the templates of my site which I print entries of one category not run and WordPress print “\includes\query.php get non object”.
The code of my templates is:
<?php if (is_page() ) { $category = 'Noticias CJE'; } if ($category) { $cat = get_cat_ID($category); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $post_per_page = 2; // -1 shows all posts $do_not_show_stickies = 1; // 0 to show stickies $args=array( 'cat' => $cat, 'paged' => $paged, 'showposts' => $post_per_page ); $temp = $wp_query; // assign orginal query to temp variable for later use $wp_query = null; $wp_query = new WP_Query($args); if( have_posts() ){ while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <strong><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2></strong> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> </div> <?php endwhile; if(function_exists('wp_pagenavi')) { wp_pagenavi(); } }else{ ?> <h2 class="center">No encontradas noticias</h2> <?php } $wp_query = $temp; //reset back to original query } // if ($category)have any of you tried this with the default theme enabled?
No, I use twentyeleven theme.
I use this Page Template to print in this page all entries of one category.
After installing 5.1.4.1 version, the problem continue.
do you have a sample url? it definitely works with 2011 as that’s what we test on
Sorry, I’m new in WordPress.
What it is 2011?
I haven’t a sample url because is in production server, sorry.
I’ve updated 5.1.4.3 version and the problem continue.
WP version 3.3.1, no multisite.
I post all my template.:
<?php /* Template Name: PageOfCJENews */ get_header('comun'); ?> <div id="primary"> <div id="content" role="main"> <?php if (is_page() ) { $category = 'Noticias CJE'; } if ($category) { $cat = get_cat_ID($category); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $post_per_page = 2; // -1 shows all posts $do_not_show_stickies = 1; // 0 to show stickies $args=array( 'cat' => $cat, 'paged' => $paged, 'showposts' => $post_per_page ); $temp = $wp_query; // assign orginal query to temp variable for later use $wp_query = null; $wp_query = new WP_Query($args); if( have_posts() ){ while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <strong><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2></strong> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> </div> <?php endwhile; if(function_exists('wp_pagenavi')) { wp_pagenavi(); } }else{ ?> <h2 class="center">No encontradas noticias</h2> <?php } $wp_query = $temp; //reset back to original query } // if ($category) ?> </div><!-- #content --> <?php get_sidebar(); ?> </div><!-- #primary --> <?php get_footer(); ?>I tried your code and seems that the problem is at lines:
$args = array( 'cat' => $cat, 'paged' => $paged, 'showposts' => $post_per_page );or maybe in your WP_Query
Your problem is that you’re assuming EM CPTs have post category taxonomies, which it doesn’t
check this out http://wp-events-plugin.com/blog/2012/01/05/catchable-fatal-error-fix-when-upgrading/
Hi Marcus,
this page template isn’t for events or locations, it’s for another entries in my wordpress, but if I activate Event Manager plugin, the template doesnt work and print the message Call to a member function get() on a non-object in [website]/wp-includes/query.php on line 27. If I deactivate the Event Manager plugin, the template run and print my entries of Noticias CJE category.
Thanks agelonwl, I’m going to check again.
Hi,
the problem is in $wp_query = new WP_Query($args);
I’ve tried
new WP_Query( 'cat=4' );and problem persist.I tried it several times and made it work; try to rename
$wp_queryto something else e.g.$wp_query1my version:
<?php /* Template Name: PageOfCJENews */ get_header('comun'); ?> <div id="primary"> <div id="content" role="main"> <?php if (is_page() ) { $category = 'Noticias CJE'; } if ($category) { $cat = get_cat_ID($category); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $post_per_page = 2; // -1 shows all posts $do_not_show_stickies = 1; // 0 to show stickies $args=array( 'cat' => $cat, 'paged' => $paged, 'showposts' => $post_per_page ); $temp = $wp_query; // assign orginal query to temp variable for later use $wp_query1 = null; $wp_query1 = new WP_Query($args); if( have_posts() ){ while ($wp_query1->have_posts()) : $wp_query1->the_post(); ?> <div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <strong><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2></strong> <div class="entry"> <?php the_content('Read the rest of this entry »'); ?> </div> </div> <?php endwhile; if(function_exists('wp_pagenavi')) { wp_pagenavi(); } }else{ ?> <h2 class="center">No encontradas noticias</h2> <?php } $wp_query = $temp; //reset back to original query } // if ($category) ?> </div><!-- #content --> <?php get_sidebar(); ?> </div><!-- #primary --> <?php get_footer(); ?>Hi agelonwl,
I tried it and the problem persists. The strange thing with the previous version of Eventa Manager did not happen and it worked OK.
I will try to downgrade to reconfirms that goes with version 5.1.3 of the plugin.
It is very strange because if I do not activate the plugin everything works OK.
Thank you very much.
that’s strange, because it works fine on my test site with the same code. Do you have a sample link?
No, sorry is in production
The topic ‘[Plugin: Events Manager] crashes \includes\query.php get non object’ is closed to new replies.