?
avatar solenthaler
solenthaler
25 Jul 2018

Steps to reproduce the issue

Update a Joomla 8.10.3 Installation from PHP 7.0 to 7.1 or 7.2
Starting the Website

Expected result

Normal Operation:

Actual result

Withe Page with
--> Fatal Error 0 Using $this when not in object context

System information (as much as possible)

Call stack

Function Location
1 ()JROOT/libraries/src/Application/CMSApplication.php:369
2 Joomla\CMS\Application\CMSApplication::getMenu() JROOT/libraries/src/Application/SiteApplication.php:275
3 Joomla\CMS\Application\SiteApplication::getMenu() JROOT/templates/aerzte_theme517/index.php:209
4 require() JROOT/libraries/src/Document/HtmlDocument.php:658
5 Joomla\CMS\Document\HtmlDocument->_loadTemplate() JROOT/libraries/src/Document/HtmlDocument.php:720
6 Joomla\CMS\Document\HtmlDocument->_fetchTemplate() JROOT/libraries/src/Document/HtmlDocument.php:535
7 Joomla\CMS\Document\HtmlDocument->parse() JROOT/libraries/src/Application/CMSApplication.php:1027
8 Joomla\CMS\Application\CMSApplication->render() JROOT/libraries/src/Application/SiteApplication.php:780
9 Joomla\CMS\Application\SiteApplication->render() JROOT/libraries/src/Application/CMSApplication.php:201
10 Joomla\CMS\Application\CMSApplication->execute() JROOT/index.php:49

Additional comments

avatar solenthaler solenthaler - open - 25 Jul 2018
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jul 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Jul 2018
avatar mbabker mbabker - change - 25 Jul 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-07-25 14:18:50
Closed_By mbabker
avatar mbabker
mbabker - comment - 25 Jul 2018

Unfortunately this is an error in your template JROOT/templates/aerzte_theme517/index.php:209. Basically, it's doing something like JSite::getMenu() or Joomla\CMS\Application\SiteApplication::getMenu() which calls the getMenu method in a static context, which is the incorrect way of calling that method. The code should be JFactory::getApplication()->getMenu().

avatar mbabker mbabker - close - 25 Jul 2018
avatar davietechfl
davietechfl - comment - 21 Oct 2018

Thank you, just worked for me on a Joomla site, changed the file as specified and site returned to normal opeation on PHP 7.1. Joomla recommended the update but without your change to the index.php site would not display, much appreciated.

avatar Real-Integrated
Real-Integrated - comment - 10 Oct 2019

@mbabker I realize this is old and closed... but you just saved me a monumental amount of time. Thank you very much.

avatar Tanyansp
Tanyansp - comment - 10 Jan 2020

Подскажите, у меня такая же проблема, но такого кода в index нет. Как решить? ошибка: Error: Call to undefined method Error::get(): Using $this when not in object context

Add a Comment

Login with GitHub to post a comment