I get this error in my System.log file

Strict Notice: Declaration of Mageplaza_Mpga_Block_Ga::getHelper() should be compatible with Mage_Core_Block_Abstract::getHelper($type).

Without seeing the code of Mageplaza_Mpga_Block_Ga I can only go be what this error usually means.

This error occurs when extending an abstract class or implementing an interface and the result method's signature does not match how it is defined.

Lets say we have an example abstract class like this:

abstract class ExampleAbstract {
    public function getExample($id);

This abstract class basically declares that all class that extend this class must have a method with the signature getExample($id) and this method must be public. You can choose to expand on the signature but you cannot take away from it. So a method signature of getExample($id,$details=false) is acceptable in this case since the original signature fits your new one. However, you cannot use the signature getExample() because you are now missing the first parameter of $id.

I believe that is what is generating the error for you. Mage_Core_Block_Abstract is declaring the method signature as getHelper($type) but in the class you are creating (and that extends the abstract class) you new method signature is getHelper(). You are missing the $type parameter which is causing the error for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.