Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
7b9c79ea
Commit
7b9c79ea
authored
Jul 19, 2016
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2674090
by Jo Fitzgerald, benjy, generalredneck, Sam152: Unable to migrate D7 link fields
parent
88d101c9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
1 deletion
+68
-1
core/modules/link/src/Plugin/migrate/cckfield/d7/LinkField.php
...modules/link/src/Plugin/migrate/cckfield/d7/LinkField.php
+30
-0
core/modules/migrate_drupal/tests/fixtures/drupal7.php
core/modules/migrate_drupal/tests/fixtures/drupal7.php
+33
-0
core/modules/migrate_drupal_ui/src/Tests/d7/MigrateUpgrade7Test.php
...es/migrate_drupal_ui/src/Tests/d7/MigrateUpgrade7Test.php
+1
-1
core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
...ules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
+4
-0
No files found.
core/modules/link/src/Plugin/migrate/cckfield/d7/LinkField.php
0 → 100644
View file @
7b9c79ea
<?php
namespace
Drupal\link\Plugin\migrate\cckfield\d7
;
use
Drupal\link\Plugin\migrate\cckfield\LinkField
as
D6LinkField
;
/**
* @MigrateCckField(
* id = "link_field",
* core = {7},
* type_map = {
* "link_field" = "link"
* }
* )
*
* This plugin provides the exact same functionality as the Drupal 6 "link"
* plugin with the exception that the plugin ID "link_field" is used in the
* field type map.
*/
class
LinkField
extends
D6LinkField
{
/**
* {@inheritdoc}
*/
public
function
getFieldWidgetMap
()
{
// By default, use the plugin ID for the widget types.
return
[
'link_field'
=>
'link_default'
];
}
}
core/modules/migrate_drupal/tests/fixtures/drupal7.php
View file @
7b9c79ea
...
...
@@ -3720,6 +3720,15 @@
'data' => 'a:6:{s:5:"label";s:4:"File";s:6:"widget";a:5:{s:6:"weight";s:1:"8";s:4:"type";s:12:"file_generic";s:6:"module";s:4:"file";s:6:"active";i:1;s:8:"settings";a:1:{s:18:"progress_indicator";s:8:"throbber";}}s:8:"settings";a:5:{s:14:"file_directory";s:0:"";s:15:"file_extensions";s:3:"txt";s:12:"max_filesize";s:0:"";s:17:"description_field";i:0;s:18:"user_register_form";i:0;}s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:12:"file_default";s:8:"settings";a:0:{}s:6:"module";s:4:"file";s:6:"weight";i:0;}}s:8:"required";i:0;s:11:"description";s:0:"";}',
'deleted' => '0',
))
->values(array(
'id' => '34',
'field_id' => '15',
'field_name' => 'field_link',
'entity_type' => 'node',
'bundle' => 'article',
'data' => 'a:7:{s:5:"label";s:4:"Link";s:6:"widget";a:5:{s:6:"weight";s:2:"10";s:4:"type";s:10:"link_field";s:6:"module";s:4:"link";s:6:"active";i:0;s:8:"settings";a:0:{}}s:8:"settings";a:12:{s:12:"absolute_url";i:1;s:12:"validate_url";i:1;s:3:"url";i:0;s:5:"title";s:8:"optional";s:11:"title_value";s:19:"Unused Static Title";s:27:"title_label_use_field_label";i:0;s:15:"title_maxlength";s:3:"128";s:7:"display";a:1:{s:10:"url_cutoff";s:2:"81";}s:10:"attributes";a:6:{s:6:"target";s:6:"_blank";s:3:"rel";s:8:"nofollow";s:18:"configurable_class";i:0;s:5:"class";s:7:"classes";s:18:"configurable_title";i:1;s:5:"title";s:0:"";}s:10:"rel_remove";s:19:"rel_remove_external";s:13:"enable_tokens";i:1;s:18:"user_register_form";b:0;}s:7:"display";a:1:{s:7:"default";a:5:{s:5:"label";s:5:"above";s:4:"type";s:12:"link_default";s:6:"weight";s:1:"9";s:8:"settings";a:0:{}s:6:"module";s:4:"link";}}s:8:"required";i:0;s:11:"description";s:0:"";s:13:"default_value";N;}',
'deleted' => '0',
))
->execute();
$connection->schema()->createTable('field_data_body', array(
...
...
@@ -4900,6 +4909,18 @@
'field_link_title' => 'Click Here',
'field_link_attributes' => 'a:1:{s:5:"title";s:10:"Click Here";}',
))
->values(array(
'entity_type' => 'node',
'bundle' => 'article',
'deleted' => '0',
'entity_id' => '2',
'revision_id' => '2',
'language' => 'und',
'delta' => '0',
'field_link_url' => '<front>',
'field_link_title' => 'Home',
'field_link_attributes' => 'a:0:{}',
))
->execute();
$connection->schema()->createTable('field_data_field_long_text', array(
...
...
@@ -6668,6 +6689,18 @@
'field_link_title' => 'Click Here',
'field_link_attributes' => 'a:1:{s:5:"title";s:10:"Click Here";}',
))
->values(array(
'entity_type' => 'node',
'bundle' => 'article',
'deleted' => '0',
'entity_id' => '2',
'revision_id' => '2',
'language' => 'und',
'delta' => '0',
'field_link_url' => '<front>',
'field_link_title' => 'Home',
'field_link_attributes' => 'a:0:{}',
))
->execute();
$connection->schema()->createTable('field_revision_field_long_text', array(
core/modules/migrate_drupal_ui/src/Tests/d7/MigrateUpgrade7Test.php
View file @
7b9c79ea
...
...
@@ -43,7 +43,7 @@ protected function getEntityCounts() {
'configurable_language'
=>
4
,
'contact_form'
=>
3
,
'editor'
=>
2
,
'field_config'
=>
4
1
,
'field_config'
=>
4
2
,
'field_storage_config'
=>
31
,
'file'
=>
1
,
'filter_format'
=>
7
,
...
...
core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
View file @
7b9c79ea
...
...
@@ -139,9 +139,13 @@ public function testNode() {
$this
->
assertIdentical
(
'title text'
,
$node
->
field_images
->
title
);
$this
->
assertIdentical
(
'93'
,
$node
->
field_images
->
width
);
$this
->
assertIdentical
(
'93'
,
$node
->
field_images
->
height
);
$this
->
assertIdentical
(
'http://google.com'
,
$node
->
field_link
->
uri
);
$this
->
assertIdentical
(
'Click Here'
,
$node
->
field_link
->
title
);
$node
=
Node
::
load
(
2
);
$this
->
assertIdentical
(
"...is that it's the absolute best show ever. Trust me, I would know."
,
$node
->
body
->
value
);
$this
->
assertIdentical
(
'internal:/'
,
$node
->
field_link
->
uri
);
$this
->
assertIdentical
(
'Home'
,
$node
->
field_link
->
title
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment