Fatal PHP error


#1

Hi there,

I’m seeing a fatal PHP error after having updated rtMedia and trying to view a Group Activity timeline. The error is as follows (full server path redacted for security reasons).

Fatal error: Call to a member function have_media() on a non-object in REDACTED/wp-content/plugins/buddypress-media/app/main/controllers/template/rt-template-functions.php on line 12

I have managed to remove the error temporarily by checking whether the PHP object is indeed an object:

 function have_rtmedia() {
        global $rtmedia_query;
        if(!empty($rtmedia_query)):
            return $rtmedia_query->have_media();
        endif;
}

However, that obviously involves editing a plugin, which is not a great solution, so it’d be great if you guys could take a look at the error and see if it can work its way back into the plugin if appropriate.

Thanks! David


#2

Hi @davros,

That is strange! Could you please confirm if you get the same error when the other plugins on your site have been disabled and any one of WordPress default theme is enabled? Kindly let us know if the error still exists.

Looking forward to hear from you. Thank you.


#3

Hi @pranalipatel http://community.easyengine.io/users/pranalipatel

Thanks for the reply. As with many Buddypress sites, all the plugins are woven in together and tightly into the theme, so I can’t easily disable any of them.

Is your thinking that $rtmedia_query might have been otherwise initialised into the global namespace? If so, I can do a search of the source code across all plugins and see if anything comes up?

Thanks


#4

Hello @davros,

Searching $rtmedia_query in source code might not help, if it has been created dynamically. Please once try if you can check with defaults, it’s really important and primary step to debug the issue. You can also create stagging site which can be exact clone of your live one for testing purpose. Can you provide us the debug info from support tab under rtmedia admin settings?

Thank you.


#5