diff --git a/core/modules/color/migration_templates/d7_color.yml b/core/modules/color/migrations/d7_color.yml similarity index 100% rename from core/modules/color/migration_templates/d7_color.yml rename to core/modules/color/migrations/d7_color.yml diff --git a/core/modules/color/src/Plugin/migrate/source/d7/Color.php b/core/modules/color/src/Plugin/migrate/source/d7/Color.php index 765a4d40ae..b33c796839 100644 --- a/core/modules/color/src/Plugin/migrate/source/d7/Color.php +++ b/core/modules/color/src/Plugin/migrate/source/d7/Color.php @@ -18,11 +18,27 @@ class Color extends VariableMultiRow { * {@inheritdoc} */ public function query() { - // Screenshot is not in Drupal 8 configuration, exclude it here. - return $this->select('variable', 'v') + // Gets active themes. + $themes = $this->select('system', 's') + ->fields('s', ['name', 'type', 'status']) + ->condition('type', 'theme') + ->condition('status', '1') + ->execute() + ->fetchCol('name'); + + // Gets color data for active themes. + $query = $this->select('variable', 'v') ->fields('v', ['name', 'value']) - ->condition('name', 'color_%', 'LIKE') + // Screenshot is not in Drupal 8 configuration, exclude it here. ->condition('name', 'color_%_screenshot', 'NOT LIKE'); + + $conditions = $query->orConditionGroup(); + foreach ($themes as $theme) { + $active_theme = 'color_' . $theme . '_%'; + $conditions->condition('name', $active_theme, 'LIKE'); + } + $query->condition($conditions); + return $query; } /**