After migrating, the Joomla! page would not show up. Instead, only the error “0 – Using $this not in object context” was showing up. In my case, I was able to fix the issue by replacing – in the code of the template – all
$application came from
$application = JFactory::getApplication().
Note that this may not be the only possible fix for this error. It highly depends on the code you have. Generally, the errormessage indicates the underlying problem: somewhere in Joomla!s code, there is a
$this inside a class which – in your code – is used, without the class being instantiated properly. In the case mentioned above, the class is initialized statically. This, because that was valid apparently in elder Joomla! versions.