I am running a legacy version of Concrete 5 from 2012 (5.5.2.1) and I am experiencing an issue out of the blue on every page load where I get the following error:
An unexpected error occurred. Using $this when not in object context
This is the code creating the error, or at least the calling code:
## now we display (provided we've gotten this far)
$v = View::getInstance();
$v->render($c);
When I dump $v out with var_dump I get this:
object(View)#4 (8) {
["viewPath":"View":private]=> NULL
["controller"]=> NULL
["headerItems":"View":private]=> array(0) { }
["footerItems":"View":private]=> array(0) { }
["themePaths":"View":private]=> array(8) {
["/dashboard"]=> string(9) "dashboard"
["/dashboard/*"]=> string(9) "dashboard"
["/page_forbidden"]=> string(8) "concrete"
["/page_not_found"]=> string(8) "concrete"
["/install"]=> string(8) "concrete"
["/login"]=> string(8) "concrete"
["/register"]=> string(8) "concrete"
["/maintenance_mode"]=> string(8) "concrete"
}
["areLinksDisabled":"View":private]=> bool(false)
["isEditingEnabled":"View":private]=> bool(true)
["error"]=> string(0) ""
}
Unfortunately my cheap host has a bug in the cPanel meaning I can't access the error logs to see what this error actually is, line number, class etc.
Is this a common issue? I am assuming my host has upgraded PHP (currently 5.6.23) and this has broken my install as I haven't touched Concrete 5 since fixing a bug in May last year.
Thanks.
This was indeed caused by my host upgrading sites to PHP 7. Concrete 5.5 does not run on PHP 7.
Reverting back to PHP 5.6 worked and now the site is back to normal.