Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
field_collection
Commits
5be6d23a
Commit
5be6d23a
authored
Mar 29, 2019
by
Ra Mänd
Browse files
Remove redundant 'else' conditions.
parent
ebe72902
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
field_collection.entity.inc
field_collection.entity.inc
+4
-4
field_collection.module
field_collection.module
+2
-1
No files found.
field_collection.entity.inc
View file @
5be6d23a
...
...
@@ -149,12 +149,12 @@ class FieldCollectionItemEntity extends Entity {
if
(
$field
[
'cardinality'
]
==
1
)
{
return
$label
;
}
elseif
(
$this
->
item_id
)
{
if
(
$this
->
item_id
)
{
return
t
(
'!instance_label @count'
,
array
(
'!instance_label'
=>
$label
,
'@count'
=>
$this
->
delta
()
+
1
));
}
else
{
return
t
(
'New !instance_label'
,
array
(
'!instance_label'
=>
$label
));
}
return
t
(
'New !instance_label'
,
array
(
'!instance_label'
=>
$label
));
}
return
t
(
'Unconnected field collection item'
);
}
...
...
field_collection.module
View file @
5be6d23a
...
...
@@ -1569,7 +1569,8 @@ function field_collection_field_get_entity(&$item, $field_name = NULL) {
}
return
$entity
;
}
elseif
(
!
isset
(
$item
[
'entity'
])
&&
isset
(
$field_name
))
{
if
(
!
isset
(
$item
[
'entity'
])
&&
isset
(
$field_name
))
{
$item
[
'entity'
]
=
entity_create
(
'field_collection_item'
,
array
(
'field_name'
=>
$field_name
));
return
$item
[
'entity'
];
}
...
...
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