Search code examples
localhostservertransferpimcore

Fatal error when moving pimcore from a server to local


I moved all my pimcore files plus the database from a server to my localhost and made the necessary changes in website/var/config/system.xml. Admin is working but the frond end is showing an error:

Fatal error: Call to a member function getFielddefinitions() on a non-object in /var/www/html/pimcore/pimcore/models/Object/Localizedfield/Resource.php on line 179

This line of code produces the error:

$this->model->getClass()->getFielddefinition("localizedfields")->getFielddefinitions()

The system requirements and file permissions are correct.

For testing purpose I installed a new pimcore project on my local system and it's working perfectly.

Can I make any changes in my Database? How can I run my project successfully on local?


Solution

  • The error is happen when there are already objects present using the class.

    Solution

    1. Login to backend as Admin.
    2. Go to Settings > Object > Classes
    3. For each of the classes in the left tree, click on them and then hit Save in the bottom right. (If unable to save just create a new class by hit the button Add new class )

    Now try to load the frondend. It will work.