Jump to content

Fatal error: Class 'IndexControllerCore' not found in /...


Recommended Posts

Hi everyone,

 

have a site that crashed, got the Fatal error, both the FO and BO are dead. I presume that admin folder name change could have caused this, since this is the only thing thad had actually been done on the site.

(Debug is on, as per code below, in defines.inc.php. Without debug on I just get the plain HTTP ERROR 500)

/* Debug only */
if (!defined('_PS_MODE_DEV_')) {
define('_PS_MODE_DEV_', true);
}

FO:

Fatal error: Class 'IndexControllerCore' not found in /home/nativome/public_html/override/controllers/front/IndexController.php on line 27

 

BO

Notice: Undefined index: adminnotfound in /home/nativome/public_html/classes/Dispatcher.php on line 335

Fatal error: Class name must be a valid object or a string in /home/nativome/public_html/classes/controller/Controller.php on line 134

 

Tried couple of things, as seen in the forum, but they don't seem to work, 

1. deleting file: /public_html/cache/class_index.php (autoregenerated) - to no effect

2. tried changing define('_PS_ADMIN_DIR_', dirname(__FILE__));, but too many files to change - no effect 

 

PrestaShop version is 1.6.1.8, on VPS server.

Using custom theme transformer.

 

Any ideas?

 

Regards,

Bojan

 
Link to comment
Share on other sites

Well not sure, here are the mentioned lines of code with Fatal error

 

Fatal error: Class 'IndexControllerCore' not found in /home/nativome/public_html/override/controllers/front/IndexController.php on line 27

{

So only curly bracket is found on line27

*/
 class IndexController extends IndexControllerCore
{
    /**
     * Assign template vars related to page content
     * @see FrontController::initContent()
     */
    /*
    * module: stoverride
    * date: 2016-02-28 17:00:42
    * version: 1.1.0
    */
    public function initContent()
    {
        parent::initContent();
        
        $this->context->smarty->assign(array(
            'HOOK_HOME_SECONDARY_LEFT' => Hook::exec('displayHomeSecondaryLeft'),
            'HOOK_HOME_SECONDARY_RIGHT' => Hook::exec('displayHomeSecondaryRight'),  
            'HOOK_HOME_TOP' => Hook::exec('displayHomeTop'),
            'HOOK_HOME_BOTTOM' => Hook::exec('displayHomeBottom'),
        ));
    }
}
Fatal error: Class name must be a valid object or a string in /home/nativome/public_html/classes/controller/Controller.php on line 134
        return new $class_name($auth, $ssl);

And a bit more of the code is here

     */
    public static function getController($class_name, $auth = false, $ssl = false)
    {
        return new $class_name($auth, $ssl);


    }
Cant really tell if theres anything wrong...
I could try replacing those files completely from a fresh installation of the same version 1.6.1.8, but I think that the result is going to be even more fatal errors...
 
 
 
Link to comment
Share on other sites

 

arty->assign(array('HOOK_HOME' => Hook::exec('displayHome'),
        'HOOK_HOME_TAB' => Hook::exec('displayHomeTab'),
        'HOOK_HOME_TAB_CONTENT' => Hook::exec('displayHomeTabContent')
    ));
    $this->setTemplate(_PS_THEME_DIR_.'index.tpl');
}

You missed some hooks also the template... But you dont need to make an override to add new hooks.

 

Regards

 

------- 

 

Hi Enrique
 
My site has a similar error.
 
Fatal error: Class "category" not found /classes/controller/Controller.php on line 134,
 
   */

    public static function getController($class_name, $auth = false, $ssl = false)

    {

        return new $class_name($auth, $ssl);

 

 

    }

 
I have the Classes / Category.php file
My version of prestashop is 1.6.1.10
 
Any idea?
Link to comment
Share on other sites

  • 2 weeks later...

It turns out that most likely some files were moved or deleted - the standard folder /controllers was gone.

So what we did is copied the entire folder from the default installation files and it did the charm, it worked.

 

Hope this helps other folks with the same or similar problem.

Consider the issue closed.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...