Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Error calling is_main_query() #263

Closed
bekarice opened this issue May 16, 2017 · 2 comments
Closed

Fatal Error calling is_main_query() #263

bekarice opened this issue May 16, 2017 · 2 comments
Assignees
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.
Milestone

Comments

@bekarice
Copy link

bekarice commented May 16, 2017

From zd-ticket-555210:

Fatal error: Uncaught Error: Call to a member function is_main_query() on null in /homepages/10/d444022076/htdocs/clickandbuilds/WordPress/vitadrom15/wp-includes/query.php:749 
Stack trace: #0 /homepages/10/d444022076/htdocs/clickandbuilds/WordPress/vitadrom15/wp-content/plugins/woocommerce-gateway-paypal-express-checkout/includes/class-wc-gateway-ppec-checkout-handler.php(73): is_main_query() 
#1 /homepages/10/d444022076/htdocs/clickandbuilds/WordPress/vitadrom15/wp-includes/class-wp-hook.php(300): WC_Gateway_PPEC_Checkout_Handler->endpoint_page_titles('') 
#2 /homepages/10/d444022076/htdocs/clickandbuilds/WordPress/vitadrom15/wp-includes/plugin.php(203): WP_Hook->apply_filters('', Array) 
#3 /homepages/10/d444022076/htdocs/clickandbuilds/WordPress/vitadrom15/wp-includes/post-template.php(158): apply_filters('the_title', '', 10882) 
#4 /homepages/10/d444022076/htdocs/clickandbuilds/WordPress/vitadrom15/wp-content/plugins/woocommerce-pdf-product-vouchers/includes/customizer/class-wc-pdf-product-vouchers-customizer.php(603): ge in /homepages/10/d444022076/htdocs/clickandbuilds/WordPress/vitadrom15/wp-includes/query.php on line 749

Looks like perhaps this needs an if ( ! is_admin() ) check?

@mdmoore mdmoore added type: bug The issue is a confirmed bug. priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. labels May 18, 2017
@mattyza mattyza modified the milestone: 1.3.0 May 22, 2017
@bor0 bor0 closed this as completed in #265 May 24, 2017
@vijayhardaha
Copy link

Having this same issue again.

CRITICAL Uncaught Error: Call to a member function is_main_query() on null in /home/customer/www/XXXXXXXX/public_html/wp-includes/query.php:915
Stack trace:
#0 /home/customer/www/XXXXXXXX/public_html/wp-content/plugins/woocommerce-gateway-paypal-express-checkout/includes/class-wc-gateway-ppec-checkout-handler.php(76): is_main_query()
#1 /home/customer/www/XXXXXXXX/public_html/wp-includes/class-wp-hook.php(294): WC_Gateway_PPEC_Checkout_Handler->endpoint_page_titles('Collected')
#2 /home/customer/www/XXXXXXXX/public_html/wp-includes/plugin.php(212): WP_Hook->apply_filters('Collected', Array)
#3 /home/customer/www/XXXXXXXX/public_html/wp-includes/post-template.php(171): apply_filters('the_title', 'Collected', 524389)
#4 /home/customer/www/XXXXXXXX/public_html/wp-content/plugins/yith-woocommerce-custom-order-status-premium/includes/class.yith-wccos-admin.php(310): get_the_title(Object(WP_Post))
#5 /home/customer/www/XXXXXXXX/public_html/wp-includes/class-wp-hook.php(292): YITH_WCCOS_Admin->get_custom_statuses(Arra in /home/customer/www/XXXXXXXX/public_html/wp-includes/query.php on line 915

But it's only happened with the custom status Collected or id 524389

what could be reason?

@nhadsall
Copy link

nhadsall commented Feb 7, 2022

We are getting the same error due to an activity log plugin calling get_the_title( $postID );

Stack trace:
#0 /home/user/public_html/wp-content/plugins/woocommerce-gateway-paypal-express-checkout/includes/class-wc-gateway-ppec-checkout-handler.php(76): is_main_query()
#1 /home/user/public_html/wp-includes/class-wp-hook.php(309): WC_Gateway_PPEC_Checkout_Handler->endpoint_page_titles('Private: Unlock...')
#2 /home/user/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters('Private: Unlock...', Array)
#3 /home/user/public_html/wp-includes/post-template.php(171): apply_filters('the_title', 'Private: Unlock...', 617344)
#4 /home/user/public_html/wp-content/plugins/aryo-activity-log/hooks/class-aal-hook-posts.php(7): get_the_title(Object(WP_Post))
#5 /home/user/public_html/wp-content/plugins/aryo-activity-log/hooks/class-aal-hook-posts.php(45): AAL_Hook_Posts->_draft_or_post_title(617344)
#6 /home/user/public_html/wp-includes/class-wp-hook.php(307): AAL_Hook_Posts->hooks_transition_post_s in /home/user/public_html/wp-includes/query.php on line 919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high The issue/PR is high priority—it affects lots of customers substantially, but not critically. type: bug The issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

6 participants