0

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.

1stthomas
  • 731
  • 2
  • 15
  • 22
crmpicco
  • 16,605
  • 26
  • 134
  • 210
  • Yes, the PHP upgrade has caused this. You'll need to update your version of concrete. – Jonnix Apr 06 '17 at 10:54
  • @JonStirling Thanks, which method of upgrade would you recommend from here? https://documentation.concrete5.org/developers/installation/upgrading-concrete5 . Obviously the remote upgrade simply isn't going to work, however anything involving accessing the dashboard as part of the upgrade I feel will fail since the code (seemingly at a core level) is broken. I am running Concrete 5.5.2.1. – crmpicco Apr 07 '17 at 03:01
  • I'm afraid I don't know upgrade processes for Concrete. My only suggestion is to test the upgrade on a separate (but identical ideally) environment first. – Jonnix Apr 07 '17 at 07:37

1 Answers1

0

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.

crmpicco
  • 16,605
  • 26
  • 134
  • 210
  • I recently updated the legacy version of concrete5. The new 5.6.4.0 version is compatible with PHP 7+. It is only available on GitHub at https://github.com/concrete5/concrete5-legacy – Michele Locati Dec 01 '17 at 06:44