Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
field_tools-3438048
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
field_tools-3438048
Commits
c4d9c87e
Commit
c4d9c87e
authored
9 years ago
by
Joachim Noreiko
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2449707
by joachim: Fixed cloning instances doesn't copy default display settings.
parent
fb49e3c9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
field_tools.admin.inc
+10
-2
10 additions, 2 deletions
field_tools.admin.inc
with
10 additions
and
2 deletions
field_tools.admin.inc
+
10
−
2
View file @
c4d9c87e
...
...
@@ -1257,9 +1257,17 @@ function _field_tools_add_instance_to_bundles($instance, $new_instances) {
continue
;
}
// Strip out keys that are specific to the instance being copied.
$instance
=
array_diff_key
(
$instance
,
array_flip
(
array
(
'id'
,
'field_id'
,
'bundle'
,
'entity_type'
,
'deleted'
)));
// Only bring back displays that have matching "view mode" in this entity type.
$instance
[
'display'
]
=
array_intersect_key
(
$original_display
,
$entity_types
[
$entity_type
][
'view modes'
]);
// Only bring back displays that have matching "view mode" in this entity
// type.
$view_modes
=
$entity_types
[
$entity_type
][
'view modes'
];
// Add a key for the default display settings, so the array intersection
// keeps them, as we always want those.
$view_modes
[
'default'
]
=
TRUE
;
$instance
[
'display'
]
=
array_intersect_key
(
$original_display
,
$view_modes
);
if
(
empty
(
$instance
[
'display'
]))
{
//@todo should there be logic to handle to no matching 'view modes'
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment