Running:
* Drupal 6.22
* Devel 1.25
* Drush 7.x-4.4

When I enable devel on my local devbox, I get the following error:


nthompson@vmdev1 drupal]$ drush en devel -y
The following extensions will be enabled: devel
Do you really want to continue? (y/n): y
devel was enabled successfully.
PHP Fatal error:  Call to undefined function pm_parse_arguments() in /var/www/html/vmdev9/drupal/sites/all/modules/devel/devel.drush.inc on line 104

Fatal error: Call to undefined function pm_parse_arguments() in /var/www/html/vmdev9/drupal/sites/all/modules/devel/devel.drush.inc on line 104
Drush command terminated abnormally due to an unrecoverable error.
Error: Call to undefined function pm_parse_arguments() in /var/www/html/vmdev9/drupal/sites/all/modules/devel/devel.drush.inc, line 104

If I disable the devel module this doesn't happen. I have done a "git pull" on core and devel and "git checkout" to the latest stable release.

Anyone else seen this? Any ideas?

Comments

monotaga’s picture

I just updated to devel 6.x-1.25 and am seeing this, too.

roball’s picture

Title: PHP Fatal error: Call to undefined function pm_parse_arguments() » PHP Fatal error: Call to undefined function pm_parse_arguments() via drush

This does only seem to happen when called via drush. No problems with Drupal itself.

moshe weitzman’s picture

yes, i screwed this up. will patch in next 24 hours. thanks for the reports.

nicholasThompson’s picture

Cheers Moshe.

It's difficult when there is an SA, you often have to release code from the dev branch a little earlier than you'd like to,.

dylon’s picture

The method seems to have been deprecated and removed from the Drush project. Apparently, all calls to pm_parse_arguments have been replaced with calls to _convert_csv_to_array. The following works:

/**
* Implements drush_MODULE_post_COMMAND().
*/
function drush_devel_post_pm_enable() {
$extensions = _convert_csv_to_array(func_get_args());
if (in_array('devel', $extensions) && !drush_get_option('skip')) {
drush_devel_download();
}
}

For anybody interested in what pm_parse_arguments did, here is its (deprecated!!!) definition:

/**
* Sanitize user provided arguments to several pm commands.
*
* Return an array of arguments off a space and/or comma separated values. It also
* lowercase arguments and optionally convert dashes to underscores.
*/
function pm_parse_arguments($args, $dashes_to_underscores = TRUE) {
$arguments = _convert_csv_to_array($args);
foreach ($arguments as $key => $argument) {
$argument = ($dashes_to_underscores)?strtr($argument, '-', '_'):$argument;
$arguments[$key] = strtolower($argument);
}
return $arguments;
}

kehan’s picture

subscribing

dkinzer’s picture

subscribing

moshe weitzman’s picture

Priority: Normal » Critical
Status: Active » Needs review

OK, I pushed a fix to Devel 6/7/8 branches. See http://drupalcode.org/project/devel.git/commitdiff/df472637e39ad11ad0d18.... Could someone update to one of those and verify that we are OK now? After verification, I will push to other branches and cut new releases.

The code causing this bug is valid for Drush5 (not yet released) but most folks are on the stable Drush4. Sorry about that.

dylon’s picture

It works very well for me on the 7 branch.

maristgeek’s picture

Seems to work for me for the 6.x-1.x branch.

moshe weitzman’s picture

Status: Needs review » Fixed

Thanks. Made new 6.x and 7.x releases. They will be downloadable in 5 mins.

John Carbone’s picture

Thanks for the quick fix! I just updated for the SA a little bit ago, ran drush, hit the error, checked again and a new release was available. Awesome.

bleen’s picture

Status: Fixed » Active

I'm seeing the following while using drush 5.0-dev also:

aross-macbook:www alex$ drush --version
drush version 5.0-dev
aross-macbook:www alex$ drush en environment_indicator -y
environment_indicator is already enabled.                                                                                     [ok]
There were no extensions that could be enabled.                                                                               [ok]

Fatal error: Call to undefined function pm_parse_arguments() in /Users/alex/..../sites/all/modules/contrib/devel/devel.drush.inc on line 104
Drush command terminated abnormally due to an unrecoverable error.                                                            [error]
Error: Call to undefined function pm_parse_arguments() in
/Users/alex/..../sites/all/modules/contrib/devel/devel.drush.inc, line 104
bleen’s picture

Status: Active » Fixed

after updating devel to 7.x-1.2 this error is fixed for drush 5 as well

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

removing [ok] and [error] from the