Currently, trying to do 'drush mb' without hook data available gets you this:

No hook definitions found. You need to download hook definitions before using this module.

Comments

dawehner’s picture

What about invoking drush mb-download directly from there?

joachim’s picture

I just committed this which was kicking around in my local copy:

- return drush_set_error('DRUSH_NOT_COMPLETED', 'No hook definitions found. You need to download hook definitions before using this module.');
+ return drush_set_error("DRUSH_NOT_COMPLETED', 'No hook definitions found. You need to download hook definitions before using this module: see the command 'mbdl'.");

But yeah, your suggestions sounds good!

joachim’s picture

> What about invoking drush mb-download directly from there?

A reason not to: you might want to specify where to save them.

aaronott’s picture

Version: » 7.x-2.x-dev
StatusFileSize
new2.04 KB

I ran into this as well so I thought, well what if we simply ask the user if they would like to download them now? This gives the user the option to download them in the default directory or saying no and doing the mb-download and specify their location.

Thoughts?

and here is the patch.

** edit **
This is a patch to drush/module_builder.drush.inc

aaronott’s picture

StatusFileSize
new2.04 KB

not sure why the patch didn't attach correctly. Let me try that again.

aaronott’s picture

A cleaner patch run from the base of the module. Could still probably ask if the user would like to save the hooks in the default location and allow them to specify a different location if No is chosen.

joachim’s picture

You seem to have included changes for another issue...

I recommend branching for every issue to avoid this sort of problem, and diffing from the main branch :)

aaronott’s picture

This would seem to be a case of being under-caffeinated. ;)

Here is a (dare I say) cleaner, cleaner patch.

joachim’s picture

Status: Active » Needs review

Cool.

I'll do some work in this on the train tomorrow maybe -- I reckon I'd like to resurrect _module_builder_check_settings() for this.

joachim’s picture

Status: Needs review » Fixed
StatusFileSize
new15.56 KB

... took me slightly longer to get to this than planned ;)

I've reworked this quite extensively to use exceptions, since they're the trendy thing and I needed to learn about them ;)
Also, they make a lot of sense here as the next step can be to have the GUI call _module_builder_sanity_check() and output dsm error messages with a link to the hook download page if needed.

Pushed to git -- can you give it a try?

Status: Fixed » Closed (fixed)

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