WP error on front end
-
Hi James
Thanks for creating this great plugin!
When I first set up the plugin I only saw the WP error screen on the feature request page. All other pages did still work, just the archive page for feature requests failed to load.
In the logs I found a fatal PHP error:
Fatal error: Uncaught Error: Call to a member function get() on null
I spent a few minutes to debug the issue, and it can be fixed very easily by changing a single
ifcondition in your code:
—
The reason for the error:
Some other plugin uses the function
get_post_meta()very early (before $wp_query is initialized). The SFR plugin intercepts this get_post_meta-call and tries to compare the query-typeis_type('single')– this is-single check fails, because wp_query is not ready yet.Would love to see this (or a similar fix) in one of the next releases 🙂
Let me know if you’d like my feedback on a possible fix or want to discuss this issue further.
Thanks, Philipp 🙂
The topic ‘WP error on front end’ is closed to new replies.