Strict Standards: Non-static method JSite::getMenu() should not be called statically
Asked Answered
R

2

11

I'm a newbee in joomla. When I change my template to other like http://www.joomla24.com/Joomla_3x_Templates/Joomla_3x_Templates/Oliverio_Lite.html

I'm getting the following error

Strict Standards: Non-static method JSite::getMenu() should not be called statically, assuming $this from incompatible context in ..\xampp\htdocs\joomla\templates\oliveriolite\index.php on line 91

Strict Standards: Non-static method JApplication::getMenu() should not be called statically, assuming $this from incompatible context in ..\xampp\htdocs\joomla\includes\application.php on line 569
Rameses answered 10/4, 2013 at 9:46 Comment(1)
This is what you get when using low quality templates, sorry. Check the line 91 and paste it here, so that we can see what the problem is.Pianissimo
I
35

It's quite simple. Your template calls a function named getMenu() statically. Meaning the call looks like this: $app::getMenu(). But it should look like this: $app->getMenu(). The variable name ($app) doesn't matter, the colon vs arrow matters.

The correct way to get the menu is:

$app = JFactory::getApplication();
$menu = $app->getMenu();

or even shorter:

$menu = JFactory::getApplication()->getMenu();
Ingleside answered 11/4, 2013 at 18:55 Comment(0)
S
-1

Also configure php.ini error_reporting works

error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED
Spinney answered 7/5, 2020 at 17:36 Comment(1)
Hiding errors is not a recommended way to solve errorsHylozoism

© 2022 - 2024 — McMap. All rights reserved.