October 3: Cannot access "parent" when current class scope has no parent

Hi all,

Im trying to run a website made using October 3 in my local environment but Im getting this really weird error

I cloned the project, ran composer install, everything went without errors

But I try to load the website, I get this:


Cannot access "parent" when current class scope has no parent

~/vendor/october/rain/src/Extension/ExtendableTrait.php line 509
        if ($callable !== null) {
            return call_user_func_array($callable, $params);
        }
  
        $parent = get_parent_class($this);
        if ($parent !== false && method_exists($parent, '__call')) {
            return parent::__call($name, $params);
        }
  
        throw new BadMethodCallException(sprintf(
            'Call to undefined method %s::%s()',
            static::class,
            $name

php artisan october:about gives me this

Environment ......................................................................................................................................  
  Application Name ..................................................................................................................... October CMS  
  Laravel Version .......................................................................................................................... 9.52.16  
  PHP Version ............................................................................................................................... 8.2.15  
  Composer Version ........................................................................................................................... 2.7.2  
  Environment .................................................................................................................................. dev  
  Debug Mode ............................................................................................................................... ENABLED  
  URL .................................................................................................................................... localhost  
  Maintenance Mode ............................................................................................................................. OFF  

  Cache ............................................................................................................................................  
  Config ................................................................................................................................ NOT CACHED  
  Events ................................................................................................................................ NOT CACHED  
  Routes ................................................................................................................................ NOT CACHED  
  Views ................................................................................................................................. NOT CACHED  

  Drivers ..........................................................................................................................................  
  Broadcasting .............................................................................................................................. pusher  
  Cache ....................................................................................................................................... file  
  Database ................................................................................................................................... mysql  
  Logs ...................................................................................................................................... single  
  Queue ....................................................................................................................................... sync  
  Session ..................................................................................................................................... file  

  October CMS ......................................................................................................................................  
  October CMS Version ........................................................................................................................ 3.6.9  
  Plugin Updates Count ........................................................................................................................... 0 

Im stuck here. Tried clearing the lavarel cache, no changes. Dont know what else to try

Im running PHP 8.2 inside a docker, everything seems to be set correctly

Same website is running also on php 8.2 on an aws server with no issues, but here I get this

Any clues? Any help will be much appreciated

Updated from 3.6.12 to 3.6.13 because of a fix:

“blueprint pagefinder replacements on link generation”

and got the same error.

1 Like

Yeah, it seems to be a problem on 3.6.13

After your post, I downgraded october/rain to 3.6.12 and the error disappeared and the site loaded normally

Apologies, some code for PHP 8.3 was introduced that broke 8.2 and earlier, and we rolled it back. Please try updating to october/rain v3.6.14 .

1 Like

If anyone in PHP land stumbles across this, PHP 8.3 appears to have removed the arguments from the get_parent_class interface to overcome the ambiguity of the target class.

If you want the exact equivalent functionality of get_parent_class() in PHP 8.3 as it was in PHP 8.2 and below:

  • get_parent_class() is equivalent to get_parent_class(self::class)
4 Likes