#1053526 by mikeryan: Machine names in drush commands now case-insensitive.
authorMike Ryan
Wed, 9 Feb 2011 00:55:48 +0000 (00:55 +0000)
committerMike Ryan
Wed, 9 Feb 2011 00:55:48 +0000 (00:55 +0000)
CHANGELOG.txt
migrate.drush.inc

index 1029212..ec26746 100644 (file)
@@ -13,6 +13,7 @@ Features and enhancements
 Let a node migration set node_revisions.uid. That's the 'last edited by' user
 
 Bug fixes
+- #1053526 - Machine names in drush commands now case-insensitive.
 - #914440 - Enhance multilingual support. 
 - #1014648 - Defaulting of file field subfields.
 - #1037872 - Make sure is_new is off for previously migrated content.
index e4ccf95..b52e24b 100644 (file)
@@ -499,12 +499,21 @@ function drush_migrate_get_migrations($args) {
   else {
     $named_migrations = array();
     foreach (explode(',', $args) as $name) {
-      $migration = $migration_objects[$name];
-      if ($migration->getEnabled()) {
-        $named_migrations[$name] = $migration;
+      $found = FALSE;
+      foreach ($migration_objects as $machine_name => $migration) {
+        if (strtolower($name) == strtolower($machine_name)) {
+          if ($migration->getEnabled()) {
+            $named_migrations[$name] = $migration;
+            $found = TRUE;
+            break;
+          }
+          else {
+            drush_log(dt('Migration !name is disabled', array('!name' => $name)), 'warning');
+          }
+        }
       }
-      else {
-        drush_print(dt('Migration !name is disabled', array('!name' => $name)));
+      if (!$found) {
+        drush_log(dt('No migration with machine name !name found', array('!name' => $name)), 'error');
       }
     }
     $migration_objects = $named_migrations;