summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorquietone2018-07-13 06:27:57 (GMT)
committerhass2018-07-13 06:27:57 (GMT)
commit18ded023654c1d9a061d6eb22fb628343617a259 (patch)
treed7e9e1fd43d4d7e1392414392b61eb2697f6d663
parentc6df832420e0938cb79d14879595cf7840385b2a (diff)
Issue #2977567 by quietone: Migrate D7 user data to D88.x-2.3
-rw-r--r--migration_templates/d6_google_analytics_user_settings.yml8
-rw-r--r--migration_templates/d7_google_analytics_user_settings.yml8
-rw-r--r--src/Plugin/migrate/process/GoogleAnalyticsSkipRowIfNotSet.php30
3 files changed, 6 insertions, 40 deletions
diff --git a/migration_templates/d6_google_analytics_user_settings.yml b/migration_templates/d6_google_analytics_user_settings.yml
index a6dfa76..98d3c23 100644
--- a/migration_templates/d6_google_analytics_user_settings.yml
+++ b/migration_templates/d6_google_analytics_user_settings.yml
@@ -12,11 +12,9 @@ process:
key: 'constants/key'
module: 'constants/module'
settings:
- # Based on skip_row_if_not_set
- plugin: google_analytics_skip_row_if_not_set
- key: custom
- module: googleanalytics
- source: data
+ plugin: skip_row_if_not_set
+ index: 'custom'
+ source: data/google_analytics
destination:
plugin: user_data
migration_dependencies:
diff --git a/migration_templates/d7_google_analytics_user_settings.yml b/migration_templates/d7_google_analytics_user_settings.yml
index 6d4e217..428c0d2 100644
--- a/migration_templates/d7_google_analytics_user_settings.yml
+++ b/migration_templates/d7_google_analytics_user_settings.yml
@@ -12,11 +12,9 @@ process:
key: 'constants/key'
module: 'constants/module'
settings:
- # Based on skip_row_if_not_set
- plugin: google_analytics_skip_row_if_not_set
- key: custom
- module: googleanalytics
- source: data
+ plugin: skip_row_if_not_set
+ index: 'custom'
+ source: data/google_analytics
destination:
plugin: user_data
migration_dependencies:
diff --git a/src/Plugin/migrate/process/GoogleAnalyticsSkipRowIfNotSet.php b/src/Plugin/migrate/process/GoogleAnalyticsSkipRowIfNotSet.php
deleted file mode 100644
index 089d685..0000000
--- a/src/Plugin/migrate/process/GoogleAnalyticsSkipRowIfNotSet.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-
-namespace Drupal\google_analytics\Plugin\migrate\process;
-
-use Drupal\migrate\ProcessPluginBase;
-use Drupal\migrate\MigrateExecutableInterface;
-use Drupal\migrate\Row;
-use Drupal\migrate\MigrateSkipRowException;
-
-/**
- * If the source evaluates to empty, we skip the current row.
- *
- * @MigrateProcessPlugin(
- * id = "google_analytics_skip_row_if_not_set",
- * handle_multiples = TRUE
- * )
- */
-class GoogleAnalyticsSkipRowIfNotSet extends ProcessPluginBase {
-
- /**
- * {@inheritdoc}
- */
- public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
- if (!isset($value[$this->configuration['module']][$this->configuration['key']])) {
- throw new MigrateSkipRowException();
- }
- return $value[$this->configuration['module']][$this->configuration['key']];
- }
-
-}