Development

#7477 ((sfDoctrine2Plugin) doctrine:generate-module throws The "default" context does not exist)

You must first sign up to be able to contribute.

Ticket #7477 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

(sfDoctrine2Plugin) doctrine:generate-module throws The "default" context does not exist

Reported by: simonvdd Assigned to: Jonathan.Wage
Priority: major Milestone:
Component: sfDoctrinePlugin Version: 1.3.0 beta1
Keywords: sfDoctrine2Plugin, Doctrine 2, sfDoctrinePlugin Cc:
Qualification: Unreviewed

Description

With sfDoctrine2Plugin, when I use the command-line tool, with command:

symfony doctrine:generate-module ...

I get an Exception saying The "default" context does not exist.

It comes from plugins/sfDoctrine2Plugin/lib/generator/sfDoctrineGenerator.class.php, which calls sfContext::getInstance() on line 32 (context is not available in console tasks).

I solved the issue by replacing this line (32):

$this->databaseManager = sfContext::getInstance()->getDatabaseManager();

by these two lines:

$configuration = sfProjectConfiguration::getActive();
$this->databaseManager = new sfDatabaseManager($configuration);

Environment: sfDoctrine2Plugin (currently embedding Doctrine 2.0.0 Alpha 1) used with Symfony 1.3.0 BETA 1 WampServer, Apache 2.2.11, PHP 5.3.0, MySQL 5.1.36

Change History

10/29/09 22:05:35 changed by simonvdd

  • version changed from 1.3.0 alpha2 to 1.3 branch.
  • summary changed from doctrine:generate-module throws The "default" context does not exist to (sfDoctrine2Plugin) doctrine:generate-module throws The "default" context does not exist.

11/03/09 19:59:42 changed by simonvdd

  • version changed from 1.3 branch to 1.3.0 beta1.

12/01/09 06:16:00 changed by Jonathan.Wage

  • status changed from new to closed.
  • resolution set to fixed.

(In [24639]) [1.4][sfDoctrine2Plugin] Fixes issue with generate-module (closes #7477)