orderedfixtures being skipped #65

Closed
ner0tic opened this Issue Nov 5, 2012 · 5 comments

Projects

None yet

4 participants

ner0tic commented Nov 5, 2012

I have an ordered set of fixtures and am getting missing index errors but unless I'm reading the ouptut wrong it seems like its skipping the fixture that loads the missing index.

$ php app/console doctrine:fixtures:load 
Careful, database will be purged. Do you want to continue Y/N ?y
  > purging database
  > loading [1] Scss\UserBundle\DataFixtures\ORM\LoadUserData
  > loading [3] Scss\GeographyBundle\DataFixtures\ORM\LoadRegionData



  [ErrorException]                                                                                                                                                                      
  Notice: Undefined index: ptc-bsa

LoadUserData is ordered as 1,
LoadOrganizationData is ordered as 2
and LoadRegionData is set for 3
the index ptc-bsa is the only fixture within the LoadOrganizationData file to be loaded.

is this a bug or am i missing something?

Member
stof commented Nov 5, 2012

can you run the command with --verbose to see where the error occurs ?

ner0tic commented Nov 5, 2012
php app/console doctrine:fixtures:load --verbose
Careful, database will be purged. Do you want to continue Y/N ?y
  > purging database
  > loading [1] Scss\UserBundle\DataFixtures\ORM\LoadUserData
  > loading [3] Scss\GeographyBundle\DataFixtures\ORM\LoadRegionData



  [ErrorException]                                                                                                                                                                      
  Notice: Undefined index: ptc-bsa in /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/ReferenceRepository.php line 145  



Exception trace:
 () at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/ReferenceRepository.php:145
 Symfony\Component\HttpKernel\Debug\ErrorHandler->handle() at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/ReferenceRepository.php:145
 Doctrine\Common\DataFixtures\ReferenceRepository->getReference() at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/AbstractFixture.php:88
 Doctrine\Common\DataFixtures\AbstractFixture->getReference() at /home/ner0tic/symfony_projects/scss/branches/2.1/src/Scss/GeographyBundle/DataFixtures/ORM/LoadRegionData.php:23
 Scss\GeographyBundle\DataFixtures\ORM\LoadRegionData->load() at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/Executor/AbstractExecutor.php:120
 Doctrine\Common\DataFixtures\Executor\AbstractExecutor->load() at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/Executor/ORMExecutor.php:83
 Doctrine\Common\DataFixtures\Executor\{closure}() at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:220
 Doctrine\ORM\EntityManager->transactional() at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/Executor/ORMExecutor.php:85
 Doctrine\Common\DataFixtures\Executor\ORMExecutor->execute() at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/doctrine/doctrine-fixtures-bundle/Doctrine/Bundle/FixturesBundle/Command/LoadDataFixturesDoctrineCommand.php:106
 Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand->execute() at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:239
 Symfony\Component\Console\Command\Command->run() at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:193
 Symfony\Component\Console\Application->doRun() at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:78
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/ner0tic/symfony_projects/scss/branches/2.1/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:106
 Symfony\Component\Console\Application->run() at /home/ner0tic/symfony_projects/scss/branches/2.1/app/console:22

doesn't shed any light for me, does it for you?

If you're getting an ErrorException the fixture should not complete its work.
Doctrine is transactional, so any data added to the database would be removed because the transaction could not complete.

Member
stof commented Feb 26, 2013

@ner0tic Are you trying to use a ptc-bsa reference in your LoadRegionData on line 23 before setting this reference in another place ?

Member

Your LoadOrganizationData is abstract and will not be loaded.

@lavoiesl lavoiesl closed this Mar 23, 2015
@lavoiesl lavoiesl added the Question label Mar 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment