Fatal error: Uncaught Error: Call to a member function query() on null after upgrading to PHP 8.0 - wordpress

One of my older WordPress websites got broken after the hosting company switched to PHP 8.0. I have deactivated all the plugins and switched to WP default theme through FTP and PHPMyadmin, and then I got a few Fatal errors, which I managed to solve, but I got really stuck with this one since I am not a developer.
Browser message:
Warning: Undefined array key "wp_the_query" in */public_html/wp-settings.php on line 342
Fatal error: Uncaught Error: Call to a member function query() on null in */public_html/wp-includes/class-wp.php:601 Stack trace: #0 */public_html/wp-includes/class-wp.php(717): WP->query_posts() #1 */public_html/wp-includes/functions.php(960): WP->main('') #2 */public_html/wp-blog-header.php(16): wp() #3 */public_html/index.php(17): require('/www/webvol20/z...') #4 {main} thrown in */public_html/wp-includes/class-wp.php on line 601
Code from /wp-includes/class-wp.php, lines 598-602:
$GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];
Code from /wp-includes/class-wp.php, lines 598-602:
public function query_posts() {
global $wp_query;
$this->build_query_string();
$wp_query->query( $this->query_vars );
Can anyone help with the code changes that I need to make? Please provide a "for dummies" style explanation :)
Already went through all web available solutions, but nothing worked. But to be honest, I wasn't able to completely understand some of them.

Related

A fatal error when viewing a 'draft' post in wordpress dashboard

The fatal error appears when I wish to preview a drafted post. I have no idea what could have possibly started this error. I will post below the entire code I see.
Fatal error: Uncaught Error: Call to a member function format() on
boolean in
/homepages/7/d680526825/htdocs/clickandbuilds/nouveautycoon/wp-content/plugins/td-cloud-library/state/single/tdb_state_single.php:777
Stack trace: #0
/homepages/7/d680526825/htdocs/clickandbuilds/nouveautycoon/wp-content/plugins/td-cloud-library/shortcodes/single/tdb_single_date.php(130):
tdb_state_single->{closure}() #1
/homepages/7/d680526825/htdocs/clickandbuilds/nouveautycoon/wp-content/plugins/td-cloud-library/shortcodes/single/tdb_single_date.php(130):
Closure->__invoke() #2
/homepages/7/d680526825/htdocs/clickandbuilds/nouveautycoon/wp-content/plugins/td-composer/legacy/common/wp_booster/td_global_blocks.php(27):
tdb_single_date->render(Array, '') #3
/homepages/7/d680526825/htdocs/clickandbuilds/nouveautycoon/wp-includes/shortcodes.php(325):
td_global_blocks::proxy_function(Array, '', 'tdb_single_date') #4
[internal function]: do_shortcode_tag(Array) #5
/homepages/7/d680526825/htdocs/clickandbuilds/nouveautycoon/wp-includes/shortcodes.php
in
/homepages/7/d680526825/htdocs/clickandbuilds/nouveautycoon/wp-content/plugins/td-cloud-library/state/single/tdb_state_single.php
on line 777 There has been a critical error on your website.
Learn more about debugging in WordPress.
Any help, will be greatly appreciated.
Thanks.
P.S. - the theme used is called newspaper and is by tagdiv.
https://nouveautycoon.comis the website in question
Updating the TDCloud Plugin Plugin should do the job. Or downloading a fresh copy and overwrite the files.

JMS Call to a member function has() on null

Bundle version 1.3.1
| Symfony version 3.3
| PHP version 7.1.9
Expected behavior
After installing the different bundles (JMSTranslationBundle, JMSDIExtraBundle, checking if i had sensio/framework-extra-bundle), and after i made the right configuration in config.yml and routing_dev.yml, the right behavior should be that the /_trans lead me to a translation interface (working), and change nothing else.
Actual behavior
Getting on a route different from /_trans return Call to a member function has() on null with error 500. Therefore, the whole site is dead, except the translation UI.
Steps to reproduce
Install JMSTranslationBundle, then when asked, install JMSDIExtraBundle to get the web ui
After that, test the /_trans. This should work. But when you get to your others routes, they return 500 error
I have exactly the same issue (Sf 3.3.9/PHP 7.1.9). I have to remove the line related to "JMSDiExtraBundle" in AppKernel to make my app works again. This is the only workaround I found, not very efficient.
Very low trace log information, this is what I have:
Stack Trace:
Logs:
CRITICAL 19:56:59 php Call to a member function has() on null
CRITICAL 19:56:59 request Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function has() on null" at /Users/stephanfo/PhpstormProjects/openbuy/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php line 233
Exception:
Any help would be helpful.
Thanks,
Stef.

Wordpress Fatal error

I'm new to wordpress, I got this error when trying to update style.css in wordpress theme, i don't think css cause the crash please help me what cause this problem:
Fatal error: Uncaught Error: Class 'td_mobile_theme' not found in
/home/staging/www/wp-content/themes/Newspaper/mobile/includes/td_global_mob.php:20
Stack trace: #0
/home/staging/www/wp-content/themes/Newspaper/mobile/functions.php(8):
require_once() #1 /home/staging/www/wp-settings.php(424):
include('/home/staging/w...') #2 /home/staging/www/wp-config.php(92):
require_once('/home/staging/w...') #3
/home/staging/www/wp-load.php(37): require_once('/home/staging/w...') #4 /home/staging/www/wp-blog-header.php(13): require_once('/home/staging/w...') #5 /home/staging/www/index.php(17):
require('/home/staging/w...') #6 {main} thrown in
/home/staging/www/wp-content/themes/Newspaper/mobile/includes/td_global_mob.php
on line 20
It appears you're either missing a plugin or it has been deactivated.
From looking at the error message and searching for unique terms, I guess you have the Newspaper-Theme installed. Their website mentions "tagDiv Mobile theme" as an optional plugin. Maybe your theme has been modified so that it's no longer optional but required?
See if that plugin is installed and activated.

Fatal error: Uncaught Error: Function name must be a string in:..wp-content\themes\jupiter\framework\admin\generators\option-generator.php:80

I developed a theme for my woocommerce store locally through jupitor wordpress them, xampp. Now I have installed wordpress on a server, and integrated the theme I developed. I get this error when i open theme option page:
Fatal error: Uncaught Error:
Function name must be a string in
H:\root\home\amanantru3-001\www\mydesign\wp-content\themes\jupiter\framework\admin\generators\option-generator.php:80
Stack trace: #0
H:\root\home\amanantru3-001\www\mydesign\wp-content\themes\jupiter\framework\admin\generators\option-generator.php(9):
mkOptionGenerator->render() #1
H:\root\home\amanantru3-001\www\mydesign\wp-content\themes\jupiter\functions.php(253):
mkOptionGenerator->__construct('Jupiter_options', Array) #2
H:\root\home\amanantru3-001\www\mydesign\wp-includes\plugin.php(524):
Theme->_load_option_page('') #3
H:\root\home\amanantru3-001\www\mydesign\wp-admin\admin.php(222):
do_action('toplevel_page_m...') #4 {main} thrown in
H:\root\home\amanantru3-001\www\mydesign\wp-content\themes\jupiter\framework\admin\generators\option-generator.php
on line 80
Also, my visual composer is not working on the server now.
Please help me...
Please check that an array is used as function name in the file.
You can check the same error reported here:
Wordpress Theme admin panel showing fatal error in local server

Fatal error when copying wordpress site from server to localhost

I've been trying to create a local copy of this wordpress site - click4taps.co.uk. But even though everything seems to run pretty much fine on the server, on localhost I am getting these code errors, I would have maybe expected a database error if I had forgot something in the setup. I'm not super good at php but I can't see anything that out of place in the code the error specifies.
Here is the error message I receive when trying to launch the site in localhost:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'woocommerce_layered_nav_init' not found or invalid function name in C:\Program Files (x86)\Ampps\www\click4taps\wp-includes\plugin.php on line 406
Fatal error: Call to undefined function is_product() in C:\Program Files (x86)\Ampps\www\click4taps\wp-content\themes\bazar\theme\plugins\woocommerce-ajax-layered-nav\init.php on line 59
Any feedback on this would be very helpful thanks
Activate your woocommerce plugin

Resources