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
4869c3e7
Commit
4869c3e7
authored
Oct 19, 2015
by
jhedstrom
Committed by
Joel Muzzerall
Oct 19, 2015
Browse files
Issue #2315921 by jhedstrom: Fixed a fatal error that can occur during migrations.
parent
2291aebf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
field_collection.migrate.inc
field_collection.migrate.inc
+7
-4
No files found.
field_collection.migrate.inc
View file @
4869c3e7
...
...
@@ -89,15 +89,18 @@ class MigrateDestinationFieldCollection extends MigrateDestinationEntity {
* was saved or FALSE on failure.
*/
public
function
import
(
stdClass
$collection
,
stdClass
$row
)
{
$updating
=
FALSE
;
if
(
isset
(
$row
->
migrate_map_destid1
))
{
// We're updated an existing entity - start from the previous data.
// entity_load() returns an array, so we get the field collection entity
// with array_shift().
$entity
=
array_shift
(
entity_load
(
'field_collection_item'
,
array
(
$row
->
migrate_map_destid1
),
array
(),
TRUE
));
$entity_old
=
clone
$entity
;
$updating
=
TRUE
;
if
(
$entity
=
array_shift
(
entity_load
(
'field_collection_item'
,
array
(
$row
->
migrate_map_destid1
),
array
(),
TRUE
)))
{
$entity_old
=
clone
$entity
;
$updating
=
TRUE
;
}
}
else
{
if
(
!
$updating
)
{
// Skip the collection if it has no host.
if
(
empty
(
$collection
->
host_entity_id
))
{
throw
new
MigrateException
(
'Could not find host entity of the field collection to import.'
);
...
...
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