I tried to run a script using drush scr. First I tried my script, then I tried the script included in drush. They both fail.

drush scr scratch

Fatal error: Call to undefined function user_roles() in /home/appa/drupal/drush/commands/core/scratch.php on line 19

Call Stack:
    0.0022     131072   1. {main}() /home/appa/drupal/drush/drush.php:0
    0.0415    1671480   2. drush_main() /home/appa/drupal/drush/drush.php:42
    0.1683    4963120   3. drush_dispatch() /home/appa/drupal/drush/drush.php:101
    0.1736    4965380   4. call_user_func_array() /home/appa/drupal/drush/includes/drush.inc:42
    0.1736    4965788   5. drush_command() /home/appa/drupal/drush/includes/drush.inc:0
    0.1753    4971600   6. call_user_func_array() /home/appa/drupal/drush/includes/command.inc:513
    0.1753    4971792   7. drush_invoke() /home/appa/drupal/drush/includes/command.inc:0
    0.1772    4983324   8. call_user_func_array() /home/appa/drupal/drush/includes/command.inc:446
    0.1772    4983740   9. drush_core_php_script() /home/appa/drupal/drush/includes/command.inc:0
    0.1784    4987364  10. include('/home/appa/drupal/drush/commands/core/scratch.php') /home/appa/drupal/drush/commands/core/core.drush.inc:745

Dush fails to locate/use Drupal API through the proper includes. The command works in drush stable (3.3). But not in HEAD. I'm using a CVS version checked out today November 15. I had a previous version that failed also.

Perhaps it's something so obvious I can't see it :(

Comments

moshe weitzman’s picture

Status: Active » Fixed

This bug was recently introduced into HEAD. Fixed now.

perusio’s picture

Yep. Tried with the current CVS snapshot. That's real quality service. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -drush, -script, -drupal api

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