Commit 5027a94d authored by alexpott's avatar alexpott
Browse files

Issue #2281627 by ultimike, jjpost | barnettech: Fixed Freeform text profile...

Issue #2281627 by ultimike, jjpost | barnettech: Fixed Freeform text profile field does not migrate properly from D6 to D7.
parent 052090f4
......@@ -53,7 +53,8 @@ public function prepareRow(Row $row) {
$row->setSourceProperty($profile_value['name'], array('value' => $date));
}
elseif ($profile_value['type'] == 'list') {
$row->setSourceProperty($profile_value['name'], explode("\n", $profile_value['value']));
// Explode by newline and comma.
$row->setSourceProperty($profile_value['name'], preg_split("/[\r\n,]+/", $profile_value['value']));
}
else {
$row->setSourceProperty($profile_value['name'], array($profile_value['value']));
......
......@@ -450,7 +450,7 @@ public static function getData($table) {
array('fid' => 9, 'uid' => 2, 'value' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam nulla sapien, congue nec risus ut, adipiscing aliquet felis. Maecenas quis justo vel nulla varius euismod. Quisque metus metus, cursus sit amet sem non, bibendum vehicula elit. Cras dui nisl, eleifend at iaculis vitae, lacinia ut felis. Nullam aliquam ligula volutpat nulla consectetur accumsan. Maecenas tincidunt molestie diam, a accumsan enim fringilla sit amet. Morbi a tincidunt tellus. Donec imperdiet scelerisque porta. Sed quis sem bibendum eros congue sodales. Vivamus vel fermentum est, at rutrum orci. Nunc consectetur purus ut dolor pulvinar, ut volutpat felis congue. Cras tincidunt odio sed neque sollicitudin, vehicula tempor metus scelerisque.'),
array('fid' => 10, 'uid' => 2, 'value' => '1'),
array('fid' => 11, 'uid' => 2, 'value' => 'Fitness spammers'),
array('fid' => 12, 'uid' => 2, 'value' => "AC/DC\nEagles"),
array('fid' => 12, 'uid' => 2, 'value' => "AC/DC\n,,Eagles\r\nElton John,Lemonheads\r\n\r\nRolling Stones\rQueen\nThe White Stripes"),
array('fid' => 13, 'uid' => 2, 'value' => "http://example.com/blog"),
array('fid' => 14, 'uid' => 2, 'value' => 'a:3:{s:5:"month";s:1:"6";s:3:"day";s:1:"2";s:4:"year";s:4:"1974";}'),
array('fid' => 8, 'uid' => 8, 'value' => 'brown'),
......
......@@ -152,7 +152,11 @@ public function testUserProfileValues() {
$this->assertEqual($user->profile_sold_to->value, 'Fitness spammers');
$this->assertEqual($user->profile_bands[0]->value, 'AC/DC');
$this->assertEqual($user->profile_bands[1]->value, 'Eagles');
#$this->assertEqual($user->profile_blog->url, 'http://example.com/blog');
$this->assertEqual($user->profile_bands[2]->value, 'Elton John');
$this->assertEqual($user->profile_bands[3]->value, 'Lemonheads');
$this->assertEqual($user->profile_bands[4]->value, 'Rolling Stones');
$this->assertEqual($user->profile_bands[5]->value, 'Queen');
$this->assertEqual($user->profile_bands[6]->value, 'The White Stripes');
$this->assertEqual($user->profile_birthdate->value, '1974-06-02');
}
......
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