bludove bludove - 5 days ago 6
PHP Question

How to correct and change a static method to a non-static method for Joomla module

I updated a client's Joomla from J2.5.28 to J3.6.4. I have corrected most of the errors but this one stumps me even after researching here. I'm a novice PHP programmer and know enough to fix a few things here and there. I researched this throughout the internet and on StackOverflow and simply do not understand how to fix the following error in my particular case. I understand I could just turn off error reporting; However I do not want to do that because [from what I did find] this doesn't actually solve the problem. Solving the problem and correcting the code is what is actually recommended.

Here is the error:

Strict Standards: Non-static method modBtContentShowcaseHelper::fetchHead() should not be called statically in ...modules/mod_bt_contentshowcase/mod_bt_contentshowcase.php on line 64

Line 64 reads as follows:

modBtContentShowcaseHelper::fetchHead( $params );


I would like to know how to correct this.

Note: Upgrading this extension is not an option because it was customized by the developer of the extension and an upgrade would wipe everything out. Contacting them usually takes several days to get a response and I need to get this corrected

Thanks in advance for the help!

Answer

You need to initiate the class modBtContentShowcaseHelper

$x = new modBtContentShowcaseHelper();
$x->fetchhead($params);
Comments