?
avatar meichenblatt
meichenblatt
24 Aug 2017

Hi,

My website is throwing this error message to the error_log file:
PHP Deprecated: Non-static method JApplicationCms::getMenu() should not be called statically in /home/sherwini/public_html/libraries/cms/application/site.php on line 272

The error is coming from a core joomla file.

Joomla version: 3.7.5, PHP 7.0

Thanks!

avatar meichenblatt meichenblatt - open - 24 Aug 2017
avatar joomla-cms-bot joomla-cms-bot - change - 24 Aug 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 Aug 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 24 Aug 2017
Category Libraries
avatar joomla-cms-bot joomla-cms-bot - edited - 24 Aug 2017
avatar mbabker
mbabker - comment - 24 Aug 2017

That's just the line emitting the error, that's not the line actually making the incorrect call.

avatar meichenblatt
meichenblatt - comment - 24 Aug 2017

Here is the code:

260 /**
261 * Return a reference to the JMenu object.
262 *
263 * @Param string $name The name of the application/client.
264 * @Param array $options An optional associative array of configuration settings.
265 *
266 * @return JMenu JMenu object.
267 *
268 * @SInCE 3.2
269 */
270 public function getMenu($name = 'site', $options = array())
271 {
272 return parent::getMenu($name, $options);
273 }

avatar franz-wohlkoenig franz-wohlkoenig - change - 24 Aug 2017
Status New Discussion
avatar mbabker
mbabker - comment - 24 Aug 2017

Without a full stack trace this cannot be pursued further. The error message only states the line/file that the error was thrown from, it does not provide information about who/what made the call and how they made it (static or object context).

avatar ggppdk
ggppdk - comment - 24 Aug 2017

At the top of the method , you can temporarily add:

if (JFactory::getUser()->authorise('core.admin', 'root.1'))
{
  echo "<pre>"; debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); echo "</pre>";
}

and then login as super admin to your website frontend
This way you will find out which extension (e.g. some file of your Joomla template or some extension related to your Joomla template) is making the call in the wrong way,
and report it to the authors of the extension

Also this an old error, you can search for it in google
there are several threads about this error
e.g.
https://stackoverflow.com/questions/15922391/strict-standards-non-static-method-jsitegetmenu-should-not-be-called-static
e.g.
https://forum.joomla.org/viewtopic.php?t=828964

avatar brianteeman
brianteeman - comment - 24 Aug 2017

I am closing this as not a core issue. This is almost always an issue with the template as explained in the links above. For further support please contact your template developer or use the forums https://forum.joomla.org

avatar brianteeman brianteeman - change - 24 Aug 2017
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-08-24 20:21:33
Closed_By brianteeman
avatar brianteeman brianteeman - close - 24 Aug 2017

Add a Comment

Login with GitHub to post a comment