Search code examples
phpprestashopprestashop-1.5

Prestashop Class AuthController does not exist


I recently moved my Prestashop installation to a new hosting, the site works as normal. However everytime i want to modify one of the SEO&URL (Back Office > Preferences > SEO & URL > click on one the page/url on the table) i always get the following error :

Fatal error: Uncaught exception 'ReflectionException' with message 'Class AuthController_ does not exist' in /path/to/prestashop/folder/classes/Meta.php:71
Stack trace: #0 /path/to/prestashop/folder/classes/Meta.php(71): ReflectionClass->__construct('AuthController_')
#1 /path/to/prestashop/folder/controllers/admin/AdminMetaController.php(229): MetaCore::getPages(true, 'index')
#2 /path/to/prestashop/folder/classes/controller/AdminController.php(1428): AdminMetaControllerCore->renderForm()
#3 /path/to/prestashop/folder/classes/controller/Controller.php(167): AdminControllerCore->initContent()
#4 /path/to/prestashop/folder/classes/Dispatcher.php(349): ControllerCore->run()
#5 /path/to/prestashop/folder/ombroadmin/index.php(50): DispatcherCore->dispatch()
#6 {main} thrown in /path/to/prestashop/folder/classes/Meta.php on line 71

I am not sure where to look/start, line 71 of Meta.php looks like this :

foreach ($files as $file)
{
    if ($file != 'index.php' && !in_array(strtolower(str_replace('Controller.php', '', $file)), $exlude_pages))
    {
        $reflection = new ReflectionClass(str_replace('.php', '', $file)); // #Line 71
        $properties = $reflection->getDefaultProperties();
        if (isset($properties['php_self']))
            $selected_pages[$properties['php_self']] = $properties['php_self'];
        else if (preg_match('/^[a-z0-9_.-]*\.php$/i', $file))
            $selected_pages[strtolower(str_replace('Controller.php', '', $file))] = strtolower(str_replace('Controller.php', '', $file));
        else if (preg_match('/^([a-z0-9_.-]*\/)?[a-z0-9_.-]*\.php$/i', $file))
            $selected_pages[strtolower(sprintf(Tools::displayError('%2$s (in %1$s)'), dirname($file), str_replace('Controller.php', '', basename($file))))] = strtolower(str_replace('Controller.php', '', basename($file)));
    }   
}

Solution

  • Check that you really have AuthController.php file at /controllers/front and compare it with the original.

    Remove file /cache/class_index.php.