Skip to content
Snippets Groups Projects
Commit 35458b5d authored by Alex Pott's avatar Alex Pott
Browse files

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

parent aa898f8b
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment