Uncaught Error: Call to a member function get_slider_language()

Viewed 343

I'm attempting to move my wordpress sites over to Google Cloud, I've moved two successfully with revslider - the third had a bloated database and I needed to trim some fat to get it in.

I'm now getting the following error when trying to view a slide from any of the front-end pages.

Fatal error: Uncaught Error: Call to a member function get_slider_language() on null in /var/www/rr/wp-content/plugins/revslider/includes/output.class.php:675 Stack trace: #0 /var/www/rr/wp-content/plugins/revslider/includes/output.class.php(634): RevSliderOutput->add_slider_base() #1 /var/www/rr/wp-content/plugins/revslider/revslider.php(96): RevSliderOutput->add_slider_to_stage('new_home', '', '', '', '') #2 /var/www/rr/wp-includes/shortcodes.php(343): rev_slider_shortcode(Array, '', 'rev_slider') #3 [internal function]: do_shortcode_tag(Array) #4 /var/www/rr/wp-includes/shortcodes.php(218): preg_replace_callback('/\\[(\\[?)(rev_sl...', 'do_shortcode_ta...', '[rev_slider sli...') #5 /var/www/rr/wp-content/plugins/js_composer/include/helpers/helpers.php(240): do_shortcode('[rev_slider sli...') #6 /var/www/rr/wp-content/plugins/js_composer/include/templates/shortcodes/vc_column.php(94): wpb_js_remove_wpautop('[rev_slider sli...') #7 /var/www/rr/wp-content/plugins/js_composer/include/classes/shortcodes/core/class-wpbakerys in /var/www/rr/wp-content/plugins/revslider/includes/output.class.php on line 675

There has been a critical error on your website.

Learn more about debugging in WordPress.

I've attempted the following steps to no avail.

  1. Switched theme.
  2. Disabled all plugins.
  3. Deleted all slides and attempted with a freshly made slide.
  4. Updated all plugins, including deleting Slider Revolution entirely and reinstalling the latest version.
  5. I removed some language packs from the VM in an attempt to claw back some space and thought that might've been it - but reinstalling with apt-get -y install "check-language-support -l en" doesn't seem to have helped.
  6. Updated to PHP 7.4.8

I'm using a Google Cloud VM with OpenLiteSpeed, and MySQL+Redis. I changed the only relevant option I could see in Slider Revolution Global Config from using default as the language to en. The slide works as expected in preview mode within the admin panel.

1 Answers

This is caused by what appears to be a bug in the Revolution Slider plugin, at least as of v6.2.21 (and it doesn't appear to have been fixed since). In revslider/includes/output.class.php:678 it calls

$lang = $rs_wmpl->get_slider_language($this->slider);

but if the WPML plugin is not installed, then $rs_wmpl is null.

Until they fix it you can hack the plugin to check for null, e.g.,

    //set slider language
    if($this->get_preview_mode() == false && !empty($rs_wmpl)){
        $lang = $rs_wmpl->get_slider_language($this->slider);
        $this->change_language($lang);
    }

Edit: This bug doesn't reproduce under ordinary page loads, but does reproduce when loading the site under WP-CLI, e.g., via wp profile. Suspect it has something to do with the way global variables are handled in that case.

Related