Using $this error with Elos template

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
ashifdev
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Jan 09, 2020 9:44 am

Using $this error with Elos template

Post by ashifdev » Thu Jan 09, 2020 10:21 am

Anybody here can help me, I am getting following error on https://www.st-solutions.co.za/

Using $this when not in object context

Call stack
# Function Location
1 () JROOT/libraries/src/Application/CMSApplication.php:370
2 Joomla\CMS\Application\CMSApplication::getMenu() JROOT/libraries/src/Application/SiteApplication.php:275
3 Joomla\CMS\Application\SiteApplication::getMenu() JROOT/templates/elos/preset/index_default.php:14
4 require() JROOT/templates/elos/index.php:27
5 require() JROOT/libraries/src/Document/HtmlDocument.php:668
6 Joomla\CMS\Document\HtmlDocument->_loadTemplate() JROOT/libraries/src/Document/HtmlDocument.php:730
7 Joomla\CMS\Document\HtmlDocument->_fetchTemplate() JROOT/libraries/src/Document/HtmlDocument.php:545
8 Joomla\CMS\Document\HtmlDocument->parse() JROOT/libraries/src/Application/CMSApplication.php:1030
9 Joomla\CMS\Application\CMSApplication->render() JROOT/libraries/src/Application/SiteApplication.php:778
10 Joomla\CMS\Application\SiteApplication->render() JROOT/libraries/src/Application/CMSApplication.php:202
11 Joomla\CMS\Application\CMSApplication->execute() JROOT/index.php:49
Last edited by toivo on Thu Jan 09, 2020 11:14 am, edited 1 time in total.
Reason: mod note: split from someone else's topic - please create your own topics in the future!

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 37798
Joined: Sat Apr 05, 2008 9:58 pm

Re: Using $this error with Elos template

Post by Webdongle » Sat Jan 11, 2020 9:21 pm

Something is out of date ... https://forumpostassistant.github.io/docs/ please.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 26331
Joined: Mon Oct 27, 2008 9:27 pm
Location: Akershus, Norway

Re: Using $this error with Elos template

Post by Per Yngve Berg » Sat Jan 11, 2020 10:26 pm

In JROOT/templates/elos/preset/index_default.php:14 change:

Code: Select all

$menu = &JSite::getMenu();
to

Code: Select all

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


Post Reply

Return to “Templates for Joomla! 3.x”