When attempting to generate a makefile for a drupal 6 site i'm given the error:

Fatal error: Call to undefined function drush_get_modules() in /var/www/drush/commands/drush_make/drush_make.generate.inc on line 35

I installed 'drush_make' directory in the /drush/commands/ directory.

Comments

budda’s picture

Status: Active » Closed (fixed)

Caused by an out of date drush install on the source server.

anarcat’s picture

Version: 6.x-2.0-beta5 » 6.x-2.0-beta6
Status: Closed (fixed) » Active

I'm seeing this here with drush 3.0-beta1, which does feature drush_get_modules()... Seems like we have a bootstrap problem of some sort here.

$ drush --allow-spaces-in-commands generate makefile ~/test.make --debug
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.04 sec, 4.35 MB]                                 [bootstrap]
Loading drushrc "/var/aegir/drupal-6.14/drushrc.php" into "drupal" scope. [0.04 sec, 4.35 MB]              [bootstrap]
Initialized Drupal 6.14 root directory at /var/aegir/drupal-6.14 [0.07 sec, 7.31 MB]                          [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.08 sec, 7.3 MB]                                  [bootstrap]
Initialized Drupal site example.com at sites/example.com [0.14 sec, 7.42 MB]        [notice]
Loading drushrc "/var/aegir/drupal-6.14/sites/example.com/drushrc.php" into "site" scope.     [bootstrap]
[0.14 sec, 7.43 MB]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.15 sec, 8.28 MB]                        [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.16 sec, 8.29 MB]                             [bootstrap]
Successfully connected to the Drupal database. [0.16 sec, 8.29 MB]                                         [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.17 sec, 8.61 MB]                                 [bootstrap]
Found command: generate makefile (commandfile=drush_make) [0.45 sec, 32.92 MB]                             [bootstrap]
Initializing drush commandfile: drush_make [0.45 sec, 32.93 MB]                                            [bootstrap]
Initializing drush commandfile: drush_make_d_o [0.45 sec, 32.93 MB]                                        [bootstrap]
Initializing drush commandfile: provision [0.45 sec, 32.93 MB]                                             [bootstrap]
Initializing drush commandfile: provision_apache [0.45 sec, 32.93 MB]                                      [bootstrap]
Initializing drush commandfile: provision_drupal [0.45 sec, 32.94 MB]                                      [bootstrap]
Initializing drush commandfile: provision_mysql [0.45 sec, 32.94 MB]                                       [bootstrap]
PHP Fatal error:  Call to undefined function drush_get_modules() in /var/aegir/.drush/drush_make/drush_make.generate.inc on line 35

Fatal error: Call to undefined function drush_get_modules() in /var/aegir/.drush/drush_make/drush_make.generate.inc on line 35
Drush command could not be completed. [15.88 sec, 34.14 MB]                                                [error]
jwilson3’s picture

I also just pulled straight from cvs drush-HEAD and installed drush_make 6.x-2.0-dev from cvs and get the same issue.

# drush generate-makefile me -v
Initialized Drupal 6.16 root directory at /home/xxx/www/example.com                        [notice]
Initialized Drupal site default at sites/default                                                       [notice]
Could not retrieve version information for <em>acquia</em>.                                         [error]

Fatal error: Call to undefined function  drush_get_modules() in /home/xxx/soft/drush-HEAD/commands/drush_make-DRUPAL-6--2/drush_make.generate.inc on line 35
Drush command could not be completed.         

^ the acquia error bothers me too... at best it should be a warning.. perhaps that should be another issue?

redben’s picture

subscribing

ldweeks’s picture

subscribing (is there a better way to subscribe to stuff?)

becw’s picture

Status: Active » Needs review
StatusFileSize
new694 bytes

I'm using Drush 3.0 RC1 and Drush Make 2.0 Beta 6 and having this problem; the problem is still present when I grab the latest from CVS. I can fix it by adding drush_include_engine('drupal', 'environment'); before the drush_get_modules() call. I don't know Drush well enough to know if this is the correct solution, but it works. Patch attached.

jonhattan’s picture

@bec this is a solution.

A better integration with drush is to just use drush_get_projects() for modules and themes. No need to include the environment engine.

becw’s picture

@jonhattan drush_get_projects() just includes the environment engine, and then calls drush_get_modules() and drush_get_themes(). Since it returns a different set of results than only calling drush_get_modules(), the surrounding code would need to be refactored. It might be the right way to do things, though :)

jonhattan’s picture

Version: 6.x-2.0-beta6 » 6.x-2.x-dev
StatusFileSize
new1.98 KB

@bec: I know.. I wrote it :)

Here is a patch using drush_get_projects() and a rework of the subsequent loop.

jonhattan’s picture

StatusFileSize
new2.02 KB

Sorry. this is the correct patch:

becw’s picture

Status: Needs review » Reviewed & tested by the community

Cool; works for me & looks good. Would it be jumping the gun to mark this RTBC?

jonhattan’s picture

Issue tags: +drush-3.0

Can't we push it up beyond critical and RTBC? :)

hunmonk’s picture

Status: Reviewed & tested by the community » Postponed

drush 3.0 will not be supported on drush make 6.x-2.x-dev. please run drush 2.x series. once we have the first stable release on the 6.x-2.x series, we'll branch and get compatibility with 3.x working.

dmitrig01’s picture

Status: Postponed » Fixed

fixed. thanks

Status: Fixed » Closed (fixed)
Issue tags: -drush-3.0

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