Hi, when I try to add the command --write I get the following errors:

PHP Fatal error: Class 'ModuleBuilderGeneratorApi' not found in /var/www/html/sites/all/modules/module_builder/includes/generators/ModuleBuilderGenerators.inc on line 142
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Class 'ModuleBuilderGeneratorApi' not found in
/var/www/html/sites/all/modules/module_builder/includes/generators/ModuleBuilderGenerators.inc,
line 142

It works when I just run "drush mb mymodule init"

Any help or suggestions are appreciated. :)

Comments

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

Could you check if you have the includes/generators/ModuleBuilderGeneratorAPI.inc file?
I'm a bit confused as to how your code can be referring to it, yet be missing it. It's definitely been committed to git!

gbirch’s picture

I'm getting exactly the same error. Installed the module just this evening from drupal.org.
Environment: Ubuntu 12.04. PHP 5.3. Drush 5.9 (installed via PEAR).
"module_builder" directory is in /home/[user]/.drush
The includes/generators/ModuleBuilderGeneratorAPI.inc file is present and readable.
Using the option combination: "--build=code --write" works just fine--no error.
Using the option combination: "--build=api --write" reproduces the error.
So does: "--build=api" even when "--write" is omitted.

joachim’s picture

Oh wait. What systems are you guys on?

The class and the file are called ModuleBuilderGeneratorAPI.

The generator name is: 'api' => 'api',

The autoloader tries to load ModuleBuilderGeneratorApi.inc, which on OS X appears to be ok loading ModuleBuilderGeneratorAPI.inc

But I seem to remember that OS X is case-preserving, but not case-sensitive for filenames.

joachim’s picture

Status: Postponed (maintainer needs more info) » Needs review

Fixed it -- I think.

Try the latest dev.

gbirch’s picture

Fix works for me. Thank you! Just by the way, I'm not sure how the process works, but your changes are only available on the git repo -- they haven't made it to drupal.org/project/module_builder yet.

joachim’s picture

The -dev release tarballs are only updated once or twice daily I think.

Thanks for reporting back!

cfgregory’s picture

Perfect! Thanks for the fast reply and fix.

joachim’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.