Commit 35458b5d authored by alexpott's avatar alexpott
Browse files

Issue #2260241 by ultimike, benjy, er.pushpinderrana: Fixed D6->D8 Profile field (date).

parent aa898f8b
......@@ -18,6 +18,9 @@ process:
textfield: text
textarea: text_long
url: link
settings:
plugin: d6_profile_field_settings
source: type
settings.allowed_values: options
cardinality:
plugin: static_map
......
<?php
/**
* @file
* Contains \Drupal\migrate_drupal\Plugin\migrate\Process\d6\ProfileFieldSettings.
*/
namespace Drupal\migrate_drupal\Plugin\migrate\Process\d6;
use Drupal\migrate\MigrateExecutable;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
/**
* @MigrateProcessPlugin(
* id = "d6_profile_field_settings"
* )
*/
class ProfileFieldSettings extends ProcessPluginBase {
/**
* {@inheritdoc}
*
* Set the profile field settings configuration.
*/
public function transform($type, MigrateExecutable $migrate_executable, Row $row, $destination_property) {
$settings = array();
switch ($type) {
case 'date':
$settings['datetime_type'] = 'date';
break;
}
return $settings;
}
}
......@@ -86,6 +86,7 @@ public function testUserProfileFields() {
// Migrated date field.
$field = entity_load('field_config', 'user.profile_birthdate');
$this->assertEqual($field->type, 'datetime', 'Field type is datetime.');
$this->assertEqual($field->settings['datetime_type'], 'date');
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment