Commit abbeb3c9 authored by webchick's avatar webchick

Issue #2588421 by neclimdul: CckLinks double unserialized attributes array

parent 829415ce
......@@ -45,8 +45,11 @@ public static function create(ContainerInterface $container, array $configuratio
* {@inheritdoc}
*/
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
// Drupal 6 link attributes are double serialized.
$attributes = unserialize(unserialize($value['attributes']));
$attributes = unserialize($value['attributes']);
// Drupal 6 link attributes might be double serialized.
if (!is_array($attributes)) {
$attributes = unserialize($attributes);
}
// Massage the values into the correct form for the link.
$route['uri'] = $value['url'];
......
......@@ -2021,6 +2021,12 @@
'field_test_value' => NULL,
'field_test_format' => NULL,
))
->values(array(
'vid' => '12',
'nid' => '9',
'field_test_value' => 'text for default value',
'field_test_format' => '1',
))
->execute();
$connection->schema()->createTable('content_field_test_text_single_checkbox', array(
......@@ -2077,6 +2083,11 @@
'nid' => '2',
'field_test_text_single_checkbox_value' => NULL,
))
->values(array(
'vid' => '12',
'nid' => '9',
'field_test_text_single_checkbox_value' => '0',
))
->execute();
$connection->schema()->createTable('content_field_test_two', array(
......@@ -2146,6 +2157,12 @@
'delta' => '0',
'field_test_two_value' => NULL,
))
->values(array(
'vid' => '12',
'nid' => '9',
'delta' => '0',
'field_test_two_value' => NULL,
))
->values(array(
'vid' => '1',
'nid' => '1',
......@@ -3233,6 +3250,34 @@
'field_test_imagefield_list' => NULL,
'field_test_imagefield_data' => NULL,
))
->values(array(
'nid' => '9',
'vid' => '12',
'uid' => '0',
'field_test_three_value' => '101.00',
'field_test_identical1_value' => NULL,
'field_test_identical2_value' => NULL,
'field_test_link_url' => 'http://www.example.com/buy-one-upon-a-time',
'field_test_link_title' => 'Buy it now',
'field_test_link_attributes' => 'a:1:{s:6:"target";s:6:"_blank";}',
'field_test_date_value' => NULL,
'field_test_datestamp_value' => NULL,
'field_test_datetime_value' => NULL,
'field_test_email_email' => NULL,
'field_test_filefield_fid' => NULL,
'field_test_filefield_list' => NULL,
'field_test_filefield_data' => NULL,
'field_test_four_value' => '101',
'field_test_integer_selectlist_value' => NULL,
'field_test_float_single_checkbox_value' => '3',
'field_test_decimal_radio_buttons_value' => NULL,
'field_test_phone_value' => NULL,
'field_test_exclude_unset_value' => 'text for default value',
'field_test_exclude_unset_format' => '1',
'field_test_imagefield_fid' => NULL,
'field_test_imagefield_list' => NULL,
'field_test_imagefield_data' => NULL,
))
->execute();
$connection->schema()->createTable('content_type_test_page', array(
......@@ -21406,6 +21451,23 @@
'tnid' => '0',
'translate' => '0',
))
->values(array(
'nid' => '9',
'vid' => '12',
'type' => 'story',
'language' => '',
'title' => 'Once upon a time',
'uid' => '1',
'status' => '1',
'created' => '1444671588',
'changed' => '1444671588',
'comment' => '2',
'promote' => '1',
'moderate' => '0',
'sticky' => '0',
'tnid' => '0',
'translate' => '0',
))
->execute();
$connection->schema()->createTable('node_access', array(
......@@ -21541,6 +21603,13 @@
'last_comment_uid' => '1',
'comment_count' => '0',
))
->values(array(
'nid' => '9',
'last_comment_timestamp' => '1444671588',
'last_comment_name' => NULL,
'last_comment_uid' => '1',
'comment_count' => '0',
))
->execute();
$connection->schema()->createTable('node_counter', array(
......@@ -21773,6 +21842,17 @@
'timestamp' => '1390095701',
'format' => '1',
))
->values(array(
'nid' => '9',
'vid' => '12',
'uid' => '1',
'title' => 'Once upon a time',
'body' => 'Come on kid, go to sleep.',
'teaser' => 'Come on kid, go to sleep.',
'log' => '',
'timestamp' => '1444671588',
'format' => '1',
))
->execute();
$connection->schema()->createTable('node_type', array(
......
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