Skip to content

Instantly share code, notes, and snippets.

@ekancepts
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekancepts/11031509 to your computer and use it in GitHub Desktop.
Save ekancepts/11031509 to your computer and use it in GitHub Desktop.
ZFCuser error

Installed following modules by adding to composer

  • zfc-user
  • zfc-user-doctrine-orm
  • doctrine-orm-module

Add following to application.config.php

  • 'DoctrineModule',
  • 'DoctrineORMModule',
  • 'ZfcBase',
  • 'ZfcUser',
  • 'ZfcUserDoctrineORM'.

Created DB 'zftest1' in postgresql

Following is the code in config/autoload/doctrine.orm.local.php:

return array(

// ...
'doctrine' => array(
    'connection' => array(
        'orm_default' => array(
            'driverClass' => 'Doctrine\DBAL\Driver\PDOPgSql\Driver',
            'params' => array(
                'host'     => 'localhost',
                'port'     => '5432',
                'user'     => 'username',
                'password' => 'password',
                'dbname'   => 'zftest1',
            )
        )
    )
),

);

After that in terminal

$ vendor/bin/doctrine-module orm:schema-tool:create
ATTENTION: This operation should not be executed in a production environment.

Creating database schema...
Database schema created successfully!

$ vendor/bin/doctrine-module orm:validate-schema
[Mapping]  OK - The mapping files are correct.
[Database] OK - The database schema is in sync with the mapping files.

When tried to Register at http://<My Local Site)/user/register

Getting following error :

An error occurred

An error occurred during execution; please try again later.

Additional information:

Doctrine\DBAL\DBALException

File:

~/zftest1/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:91

Message:

An exception occurred while executing 'SELECT t0.username AS username1, t0.email AS email2, t0.display_name AS display_name3, t0.password AS password4, t0.state AS state5, t0.user_id AS user_id6 FROM user t0 WHERE t0.user_id = ?' with params [2]:

SQLSTATE[42703]: Undefined column: 7 ERROR:  column t0.username does not exist
LINE 1: SELECT t0.username AS username1, t0.email AS email2, t0.disp...
           ^

Stack trace:

#1 ~/zftest1/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php(748): Doctrine\DBAL\Connection->executeQuery('SELECT t0.usern...', Array, Array)

#2 ~/zftest1/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(460): Doctrine\ORM\Persisters\BasicEntityPersister->load(Array)

#3 ~/zftest1/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(154): Doctrine\ORM\EntityManager->find('ZfcUserDoctrine...', 2, 0, NULL)

#4 ~/zftest1/vendor/zf-commons/zfc-user-doctrine-orm/src/ZfcUserDoctrineORM/Mapper/User.php(46): Doctrine\ORM\EntityRepository->find(2)

#5 ~/zftest1/vendor/zf-commons/zfc-user/src/ZfcUser/Authentication/Storage/Db.php(71): ZfcUserDoctrineORM\Mapper\User->findById(2)

#6 ~/zftest1/vendor/zf-commons/zfc-user/src/ZfcUser/Authentication/Storage/Db.php(45): ZfcUser\Authentication\Storage\Db->read()

#7 ~/zftest1/vendor/zendframework/zendframework/library/Zend/Authentication/AuthenticationService.php(134): ZfcUser\Authentication\Storage\Db->isEmpty()

#8 ~/zftest1/vendor/zf-commons/zfc-user/src/ZfcUser/Controller/Plugin/ZfcUserAuthentication.php(34): Zend\Authentication\AuthenticationService->hasIdentity()

#9 ~/zftest1/vendor/zf-commons/zfc-user/src/ZfcUser/Controller/UserController.php(63): ZfcUser\Controller\Plugin\ZfcUserAuthentication->hasIdentity()

#10 ~/zftest1/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(83): ZfcUser\Controller\UserController->indexAction()

#11 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))

#12 ~/zftest1/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))

#13 ~/zftest1/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

#14 ~/zftest1/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(117): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

#15 ~/zftest1/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(114): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))

#16 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))

#17 ~/zftest1/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))

#18 ~/zftest1/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

#19 ~/zftest1/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(313): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

#20 ~/zftest1/public/index.php(17): Zend\Mvc\Application->run()

#21 {main}

Previous exceptions:

PDOException

File:

~/zftest1/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:694

Message:

SQLSTATE[42703]: Undefined column: 7 ERROR:  column t0.username does not exist

LINE 1: SELECT t0.username AS username1, t0.email AS email2, t0.disp...
           ^

Stack trace:

#0 ~/zftest1/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(694): PDOStatement->execute()

#1 ~/zftest1/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php(748): Doctrine\DBAL\Connection->executeQuery('SELECT t0.usern...', Array, Array)

#2 ~/zftest1/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(460): Doctrine\ORM\Persisters\BasicEntityPersister->load(Array)

#3 ~/zftest1/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(154): Doctrine\ORM\EntityManager->find('ZfcUserDoctrine...', 2, 0, NULL)

#4 ~/zftest1/vendor/zf-commons/zfc-user-doctrine-orm/src/ZfcUserDoctrineORM/Mapper/User.php(46): Doctrine\ORM\EntityRepository->find(2)

#5 ~/zftest1/vendor/zf-commons/zfc-user/src/ZfcUser/Authentication/Storage/Db.php(71): ZfcUserDoctrineORM\Mapper\User->findById(2)

#6 ~/zftest1/vendor/zf-commons/zfc-user/src/ZfcUser/Authentication/Storage/Db.php(45): ZfcUser\Authentication\Storage\Db->read()

#7 ~/zftest1/vendor/zendframework/zendframework/library/Zend/Authentication/AuthenticationService.php(134): ZfcUser\Authentication\Storage\Db->isEmpty()

#8 ~/zftest1/vendor/zf-commons/zfc-user/src/ZfcUser/Controller/Plugin/ZfcUserAuthentication.php(34): Zend\Authentication\AuthenticationService->hasIdentity()

#9 ~/zftest1/vendor/zf-commons/zfc-user/src/ZfcUser/Controller/UserController.php(63): ZfcUser\Controller\Plugin\ZfcUserAuthentication->hasIdentity()

#10 ~/zftest1/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractActionController.php(83): ZfcUser\Controller\UserController->indexAction()

#11 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))

#12 ~/zftest1/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))

#13 ~/zftest1/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

#14 ~/zftest1/vendor/zendframework/zendframework/library/Zend/Mvc/Controller/AbstractController.php(117): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

#15 ~/zftest1/vendor/zendframework/zendframework/library/Zend/Mvc/DispatchListener.php(114): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))

#16 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))

#17 ~/zftest1/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))

#18 ~/zftest1/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

#19 ~/zftest1/vendor/zendframework/zendframework/library/Zend/Mvc/Application.php(313): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))

#20 ~/zftest1/public/index.php(17): Zend\Mvc\Application->run()

#21 {main}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment