Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
221
Merge Requests
221
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
7c8934d0
Commit
7c8934d0
authored
Aug 23, 2019
by
Gábor Hojtsy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#3067889
by quietone: Boolean Field On and Off Label not Migrating
parent
868da6c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceSettings.php
...d/src/Plugin/migrate/process/d7/FieldInstanceSettings.php
+10
-0
core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
.../tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
+7
-0
No files found.
core/modules/field/src/Plugin/migrate/process/d7/FieldInstanceSettings.php
View file @
7c8934d0
...
...
@@ -65,6 +65,16 @@ public function transform($value, MigrateExecutableInterface $migrate_executable
$instance_settings
[
'handler_settings'
]
=
$field_settings
[
'handler_settings'
];
}
// Get the labels for the list_boolean type.
if
(
$row
->
getSourceProperty
(
'type'
)
===
'list_boolean'
)
{
if
(
isset
(
$field_data
[
'settings'
][
'allowed_values'
][
1
]))
{
$instance_settings
[
'on_label'
]
=
$field_data
[
'settings'
][
'allowed_values'
][
1
];
}
if
(
isset
(
$field_data
[
'settings'
][
'allowed_values'
][
0
]))
{
$instance_settings
[
'off_label'
]
=
$field_data
[
'settings'
][
'allowed_values'
][
0
];
}
}
switch
(
$widget_type
)
{
case
'image_image'
:
$settings
=
$instance_settings
;
...
...
core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceTest.php
View file @
7c8934d0
...
...
@@ -150,6 +150,13 @@ public function testFieldInstances() {
$this
->
assertNull
(
$name_field
);
$description_field
=
FieldConfig
::
load
(
'taxonomy_term.test_vocabulary.description_field'
);
$this
->
assertNull
(
$description_field
);
$boolean_field
=
FieldConfig
::
load
(
'node.test_content_type.field_boolean'
);
$expected_settings
=
[
'on_label'
=>
'1'
,
'off_label'
=>
'Off'
,
];
$this
->
assertSame
(
$expected_settings
,
$boolean_field
->
get
(
'settings'
));
}
/**
...
...
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