$migration->mergeProcessOfProperty('options/type', $process);
}
+ /**
+ * {@inheritdoc}
+ */
+ public function getFieldFormatterType(Row $row) {
+ return $row->getSourceProperty('formatter/type');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getFieldFormatterMap() {
+ return [];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getFieldWidgetType(Row $row) {
+ return $row->getSourceProperty('widget/type');
+ }
+
/**
* {@inheritdoc}
*/
*/
public function processFieldFormatter(MigrationInterface $migration) {
$process = [];
+
+ // Some migrate field plugin IDs are prefixed with 'd6_' or 'd7_'. Since the
+ // plugin ID is used in the static map as the module name, we have to remove
+ // this prefix from the plugin ID.
+ $plugin_id = preg_replace('/d[67]_/', '', $this->pluginId);
foreach ($this->getFieldFormatterMap() as $source_format => $destination_format) {
- $process[0]['map'][$this->pluginId][$source_format] = $destination_format;
+ $process[0]['map'][$plugin_id][$source_format] = $destination_format;
}
$migration->mergeProcessOfProperty('options/type', $process);
}
+ /**
+ * {@inheritdoc}
+ */
+ public function processFieldValues(MigrationInterface $migration, $field_name, $data) {
+ $process = [
+ 'plugin' => 'get',
+ 'source' => $field_name,
+ ];
+ $migration->mergeProcessOfProperty($field_name, $process);
+ }
+
/**
* {@inheritdoc}
*/