This issue is caused by using drush mb with MAMP and php 5.4.4.

array_fill_keys() expects parameter 1 to be array, null given module_builder.drush.inc:420                                                                                                                            [warning]
Drush command terminated abnormally due to an unrecoverable error.
[error]
Error: Unsupported operand types in .../module_builder/drush/module_builder.drush.inc, line 421

Looks like some variables aren't being checked.

CommentFileSizeAuthor
#1 module_builder-php_error-1896954-1.patch975 bytesJaesin

Comments

Jaesin’s picture

StatusFileSize
new975 bytes

A quick fix for this issue.

joachim’s picture

Status: Active » Needs work

Well spotted. Looks like the problem occurs when you specify a preset group that doesn't exist.

+++ b/drush/module_builder.drush.inc
@@ -416,9 +416,13 @@ function module_builder_build_data($commands) {
+      if(is_array($hook_presets[$preset_name]['hooks'])){

I'd rather we checked with isset rather than is_array(), as it makes more sense: we're checking the hook group exists. A comment to that effect would be good here too.

+++ b/drush/module_builder.drush.inc
@@ -416,9 +416,13 @@ function module_builder_build_data($commands) {
+      if(is_array($preset_hooks)){

We don't need a second if(), we can just go inside the first one.

It looks like your patch is adding tabbed indentation rather than spaces too.

joachim’s picture

Status: Needs work » Fixed

Committed the fix with my modifications.

Thanks for reporting this!

Jaesin’s picture

No problem.

Status: Fixed » Closed (fixed)

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