Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.5.13, get_query_var
- This topic has 1 reply, 2 voices, and was last updated 10 years, 4 months ago by
Steven Zahm.
-
AuthorPosts
-
04/07/2016 at 9:26 pm #372067
Kathy Allen
ParticipantHave just found that the connection plugin has caused an error on the blog/posts page.
Fatal error: Call to a member function get() on a non-object in /home/website/public_html/wp-includes/query.php on line 28
04/08/2016 at 10:29 am #372136Steven Zahm
Keymaster@ Kathy
This is actually not a bug in Connections, more likely a bug in the theme which is incorrectly using and therefor breaking the global WordPress variable
$wp_query. You can read the nitty gritty details in this FAQ.I run into this issue 5–6 times a year. Mostly in older theme’s which have not been updated in quite awhile. On odd occasion I see it in a newer theme. Likely because the theme dev copied the code from an old tutorial. Of course, the later, is just a guess.
I’m also been running into a new variation of this. A plugin or theme, maybe even the actual users are editing a core WordPress file
query.phpby commenting out code which will break a lot of plugins, silently. More about it in this post.All this said…
I use a core WordPress function named
get_quer_var()extensively throughout Connections. Which is the proper best practice in order to retrieve a public query variable registered with the core WordPressWP_Queryclass.Since this is a core WordPress function and I am quite correctly using
get_query_var()to retrieve it. This function should “just work”. However, those two issues mentioned above being caused by third party themes and plugins causes Connections to break about a dozen reported times a year. It important to note that this does not only affect Connections, but every other plugin which correctly uses theget_query_var()function.I’ve come up with a work around which will be included in the next release of Connections. This work around involves creating a wrapper function for
get_query_var(). I updated well over 300 instances ofget_query_var()function used in Connections to use this new wrapper function.What does this wrapper function do? It checks that
get_query_var()is callable and that the$wp_queryvariable is not “broken”. If both are okget_query_var()is used like normal. If either are “broken” I go thru several other checks and in each check try to call the query variable a different way.In short, this should work around the issue being caused by third party plugins and theme.
Now, this will not fix other plugins being broken silently by the same issue. So if you run into other odd quirks or something else not working with other plugins it could very well be the very same issue that affected Connections.
I know this is a long technical reply but I hope it helps!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
