WordPress.org

Ready to get started?Download WordPress

Forums

Pods - Custom Content Types and Fields
[resolved] Fatal Error get() (28 posts)

  1. imageDESIGN
    Member
    Posted 1 year ago #

    Upgrading from 1.14.5 within WP 3.4.2 causes the following error:
    PHP Fatal error: Call to a member function get() on a non-object in wp-includes/query.php on line 27

    http://wordpress.org/extend/plugins/pods/

  2. pglewis
    Member
    Plugin Contributor

    Posted 1 year ago #

    I've filed a GitHub issue: https://github.com/pods-framework/pods/issues/497

    We'll get to the bottom of it.

  3. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    Hey there, looks like a very odd issue we haven't yet seen on any sites before.

    Would you be open to letting me get in and fix it for you?

    https://podsframework.org/submit-site-credentials/

  4. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    I ended up patching with a fix which should resolve this. It's in Pods 2.0.2, so please let us know if you have any further issues. Our top priority is ensuring no bugs like this occur for all of our awesome users :)

  5. imageDESIGN
    Member
    Posted 1 year ago #

    Scott & pglewis, thanks for your help. The issue remains with Pods 2.0.2 I have submitted my info for you just now - Thanks!

  6. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    Didn't get this notification e-mail yet so pglewis clued me in.

    Thanks for submitting your info, we're very puzzled with the issue and want to get it resolved for you asap.

  7. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    It seems like an issue with another caching plugin, Quick Cache. Not sure what's up there yet.

  8. stefwilliams
    Member
    Posted 1 year ago #

    For the record, I get this issue as well, with Pods 2.0.4.1 on WP 3.4.2
    Am running Xampp lite and PHP 5.3.1.
    Will try installing on a full version of Xampp later and report back.
    I do not have Quick Cache installed, or any other caching plugin.
    Very few plugins installed in fact.

  9. stefwilliams
    Member
    Posted 1 year ago #

    ok,
    tried it on my other install, and the same problem - Fatal error.
    The one thing I have in common with both installs is that I have Events Manager installed...
    Deactivate that and Pods seems to run with no problem. Activate one or the other and all is well...
    Activate both at the same time, and BOOM!
    Looks like they don't get along...
    Any chance of fixing it? I have no clue what could be causing it myself.

  10. guix69
    Member
    Posted 1 year ago #

    same thing for me, events manager installed as well...

  11. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    Looking into this, we've done everything we can do to limit this kind of stuff from happening as all of our wp_cache calls have checks if the $wp_object_cache has been init yet. I'll see if Events Manager isn't doing that or something else is going on.

  12. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    This is the plugin you are all having compatibility issues with, right?

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

  13. guix69
    Member
    Posted 1 year ago #

    exactly, thanks for looking into it.

  14. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    It looks like it's the events-manager/em-ical.php file

    It's doing something in parse_query that is getting messed up, but Pods doesn't interact with parse_query or $wp_query. I'm still digging into it to see what's going on.

  15. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    Pods makes a get_posts call before $wp_query is set, the Events Calendar plugin is hooking into parse_query but using a $wp_query variable check with get_query_var which fails, because $wp_query isn't set yet. This seems like a bug with WordPress core itself really, but I'll contact the Events Manager author with a workaround for him until then.

  16. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    I contacted the author, watch for an update soon from that plugin which should resolve this conflict.

    For now, just add this to a plugin, it disables the iCal from being available but both plugins will work until the update:

    function fix_em_ical () {
        remove_action ( 'parse_query', 'em_ical_event' );
    }
    add_action( 'plugins_loaded', 'fix_em_ical', 9 );
  17. Marcus
    NetWebLogic Support
    Posted 1 year ago #

    got the email, thanks Scott! will look into this and fix.

  18. stefwilliams
    Member
    Posted 1 year ago #

    Hi,
    Just tried using that little bit of code (inserted into a different plugin), but am still getting the error - generally on saving fields in a Pod.
    Just to check, does it make any difference where it goes? I've tried inserting it into one of my own plugins, but not sure whether it would be better off in EM, Pods, or functions.php

  19. stefwilliams
    Member
    Posted 1 year ago #

    Having said that, tried it in various places, and still no joy.

  20. Marcus
    NetWebLogic Support
    Posted 1 year ago #

    Btw, this is now fixed in our update 5.2.9. Props to Scott for figuring out the root of the problem.

  21. guix69
    Member
    Posted 1 year ago #

    great news :)

  22. imageDESIGN
    Member
    Posted 1 year ago #

    The Event Manager updated solved my conflict for upgrade as well. Thanks!

  23. Aaron
    Member
    Posted 1 year ago #

    Just a heads up, I had to code a workaround for this very issue in our WPMU DEV MarketPress plugin.

    You can see the details here: http://premium.wpmudev.org/forums/topic/marketpress-conflict-with-pods-plugin?replies=9#post-334908

    Ok, there seemed to be a bug in PODS in their activation function. It was only run on activation, or first install pageload. Something in it is unsetting the $wp_query object before the 'pre_get_posts' action hook which is supposed to pass $wp_query, already initialized (hence it's a PODs bug as it's breaking a core hook).

    I was able to put a workaround in the 'pre_get_posts' in MarketPress's situation as didn't need to use that filter admin side, but this issue could cause problems with other plugins as well.

    Essentially I think you should find a way to not call get_posts() before the main WP query. All those hooks like 'parse_query' and 'pre_get_posts' assume the $wp_query global is set, and pass it as a reference to be accessed. So of course plugin authors would expect it to be set already.

    Note this problem only seems to be in your initial activation or first page load after activation function. If I disabled those hooks, activated pods, then reenabled them all was fine. I'm sure you can find a different way to code that for better compatibility of other plugins.

    Thanks!

  24. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    I'll work on making that adjustment, I thought more plugins ran their init further down the actions line, closer to the 'init' action, or at least 'setup_theme'. Instead of on 'plugins_loaded' I'll work on hooking into it at 'setup_theme'.

    The technical capability to call WP_Query prior to $wp_the_query/$wp_query globals being set should still be watched out for in general, so I'd still recommend you also use your add_action integrations with WP_Query during 'setup_theme'.

  25. Aldi
    Member
    Posted 1 year ago #

    I'm also experienceing the same issue, with Pods 2.2 on WP 3.4.2, running Xampp 1.7.7 and PHP 5.3.8.

    I'm not using Events Manager, so it's probably conflicting with some other plugins. Haven't figured out which one yet but I'll try to report it if I ever found out.

  26. Aldi
    Member
    Posted 1 year ago #

    Okay.. I found the conflicting plugin: WP-CommentNavi (http://wordpress.org/extend/plugins/wp-commentnavi/)

    However, if I deactivate WP-CommentNavi, then activate PODS, then activate WP-CommentNavi again, it seems to work. But I have yet to test if PODS will function well, though, with both plugins installed.

  27. Aldi
    Member
    Posted 1 year ago #

    Okay, so functionality wise, it's broken with both installed. I can't create new PODs without getting the Fatal Error all over again.

    UPDATE:
    Seems like this line below is what's causing the error:

    add_action('pre_get_posts', 'commentnavi_allcomments');

    Any workaround?

  28. Scott Kingsley Clark
    Member
    Plugin Author

    Posted 1 year ago #

    Pods 2.3 no long has this issue, confirmed with a few other people who had the same conflict errors. It's still in Alpha testing, you could do this for now in your own plugin or theme's functions.php file:

    remove_action('pre_get_posts', 'commentnavi_allcomments');
    add_action('pre_get_posts', my_commentnavi_allcomments');
    
    function my_commentnavi_allcomments () {
        global $wp_query;
    
        if ( isset( $wp_query ) && is_object( $wp_query ) )
            commentnavi_allcomments();
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.