Directly after initing a new admin-generated module from the command line, going to the module in either dev or live mode will generate an exception:
[sfParseException]
You must specify a "moduleName"
The trace is below:
stack trace
at ()
in SF_SYMFONY_LIB_DIR/generator/sfCrudGenerator.class.php line 52 ...
$error = 'You must specify a "%s"';
$error = sprintf($error, $entry);
throw new sfParseException($error);
}
}
at sfCrudGenerator->generate(array('model_class' => 'User', 'theme' => 'default', null))
in SF_SYMFONY_LIB_DIR/generator/sfGeneratorManager.class.php line 55 ...
at sfGeneratorManager->generate('sfPropelAdminGenerator', array('model_class' => 'User', 'theme' => 'default', null))
in SF_SYMFONY_LIB_DIR/config/sfGeneratorConfigHandler.class.php line 76 ...
at sfGeneratorConfigHandler->execute(array('/Applications/MAMP/bin/php5/lib/php/data/symfony/config/generator.yml', '/Users/karlkatzke/work/corpworlds/apps/backend/config/generator.yml', '/Users/karlkatzke/work/corpworlds/apps/backend/modules/user/config/generator.yml'))
in SF_SYMFONY_LIB_DIR/config/sfConfigCache.class.php line 103 ...
at sfConfigCache->callHandler('modules/user/config/generator.yml', array('/Applications/MAMP/bin/php5/lib/php/data/symfony/config/generator.yml', '/Users/karlkatzke/work/corpworlds/apps/backend/config/generator.yml', '/Users/karlkatzke/work/corpworlds/apps/backend/modules/user/config/generator.yml'), '/Users/karlkatzke/work/corpworlds/cache/backend/dev/config/modules_user_config_generator.yml.php')
in SF_SYMFONY_LIB_DIR/config/sfConfigCache.class.php line 190 ...
at sfConfigCache->checkConfig('modules/user/config/generator.yml', '1')
in SF_SYMFONY_LIB_DIR/config/sfConfigCache.class.php line 248 ...
at sfConfigCache->import('modules/user/config/generator.yml', '1', '1')
in SF_SYMFONY_LIB_DIR/controller/sfController.class.php line 194 ...
at sfController->forward('user', 'index')
in SF_SYMFONY_LIB_DIR/controller/sfFrontWebController.class.php line 48 ...
at sfFrontWebController->dispatch()
in SF_ROOT_DIR/web/backend_dev.php line 10 ...
The problem is a typo within sfGeneratorConfigHandler.class.php - line 69 looks like:
preg_match('#'.sfConfig::get('sf_app_module_dir_name').'/([/]+)/#', $configFiles[1], $match);
... $configFiles[1] should be $configFiles[2], because $configFiles[0] is $projectroot/config, $configfiles[1] is $projectroot/apps/$project/config/generator.yml, and $configfiles[3] is $projectroot/apps/$project/modules/$module/config/generator.yml -- it would be rather difficult to get the modulename from the $configFiles[1] variable.
Either way, that's kind of a nasty hack that depends on a config file being present for the generated files, and really should be thought hard about. A good solution would be to add the module name to the generator.yml or the actions.class.php file, as it's known when we do the propel-init-admin... but has to be hacked out later.