WEB-Error: 0 - Using $this when not in object context Topic is solved

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
KG_Berlin
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Nov 11, 2018 12:19 pm

WEB-Error: 0 - Using $this when not in object context

Post by KG_Berlin » Sun Nov 11, 2018 12:29 pm

Hi Forum,
today I call my web-page and receive an error message

"0 - Using $this when not in object context
You may not be able to visit this page because of:

an out-of-date bookmark/favourite
a search engine that has an out-of-date listing for this site
a mistyped address
you have no access to this page
The requested resource was not found.
An error has occurred while processing your request.

Please try one of the following pages:

Home Page
"
I use:
Joomla 3.9.0
PHP 7.2
No additional modules installed.

My page is not accessible.
Can anybody help me?
Last edited by KG_Berlin on Sun Nov 11, 2018 12:57 pm, edited 1 time in total.

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2906
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: WEB-Error: 0 - Using $this when not in object context

Post by SharkyKZ » Sun Nov 11, 2018 12:49 pm

Enable debug (Debug System option in Global Configuration) to see where this error is coming from.

KG_Berlin
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Nov 11, 2018 12:19 pm

Re: WEB-Error: 0 - Using $this when not in object context

Post by KG_Berlin » Sun Nov 11, 2018 1:02 pm

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/borrennature/index.php:142
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:1030
8 Joomla\CMS\Application\CMSApplication->render() JROOT/libraries/src/Application/SiteApplication.php:778
9 Joomla\CMS\Application\SiteApplication->render() JROOT/libraries/src/Application/CMSApplication.php:202
10 Joomla\CMS\Application\CMSApplication->execute() JROOT/index.php:39

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

Re: WEB-Error: 0 - Using $this when not in object context

Post by Webdongle » Sun Nov 11, 2018 1:03 pm

http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

SharkyKZ
Joomla! Hero
Joomla! Hero
Posts: 2906
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: WEB-Error: 0 - Using $this when not in object context

Post by SharkyKZ » Sun Nov 11, 2018 1:40 pm

Open templates/borrennature/index.php and change

Code: Select all

JSite::getMenu()
to

Code: Select all

JFactory::getApplication()->getMenu()

KG_Berlin
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Nov 11, 2018 12:19 pm

Re: WEB-Error: 0 - Using $this when not in object context

Post by KG_Berlin » Sun Nov 11, 2018 1:52 pm

aaaaaaaaaaaaaaaaaaaaa..... wow wow wow. You know what you talking about !! Great. It works.
many many thanks.
KG

User avatar
pmleconte
Joomla! Guru
Joomla! Guru
Posts: 591
Joined: Fri Mar 17, 2017 12:55 pm
Location: France

Re: WEB-Error: 0 - Using $this when not in object context

Post by pmleconte » Sun Nov 11, 2018 1:59 pm

Hi,

Just a quick comment : your website has been using syntax not supposed to work since 2013 (see https://stackoverflow.com/questions/159 ... led-static)

So, when you write that you called your web-page today and it did not work. When was the last time you looked at it ?

Pascal
If anything can go wrong, it will.
https://www.conseilgouz.com/en

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

Re: WEB-Error: 0 - Using $this when not in object context

Post by Webdongle » Sun Nov 11, 2018 4:42 pm

That is why ... viewtopic.php?f=714&t=793531 please
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

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

Re: WEB-Error: 0 - Using $this when not in object context

Post by Per Yngve Berg » Sun Dec 15, 2019 8:27 am

Don't forget to update your Joomla. The current version is 3.9.13


Locked

Return to “General Questions/New to Joomla! 3.x”