Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
field_collection
Commits
1b1d38dd
Commit
1b1d38dd
authored
Nov 03, 2019
by
istryker
Committed by
Ra Mänd
Nov 03, 2019
Browse files
Issue #3091188 by iStryker: Field Collection stop working
parent
b3dc9398
Changes
1
Hide whitespace changes
Inline
Side-by-side
field_collection.module
View file @
1b1d38dd
<?php
/**
* @file
* Module implementing field collection field type.
...
...
@@ -963,7 +964,7 @@ function field_collection_entity_preload($entities, $langcode, &$items, $fields)
static
$local_entity_cache
=
array
();
$fc_ids
=
array
();
$new_items
=
array
();
// Collect every possible term attached to any of the fieldable entities.
foreach
(
$entities
as
$id
=>
$entity
)
{
foreach
(
$items
[
$id
]
as
$delta
=>
$item
)
{
...
...
@@ -982,6 +983,7 @@ function field_collection_entity_preload($entities, $langcode, &$items, $fields)
if
(
$fc_ids
)
{
$new_entities
=
array
();
$terms
=
field_collection_item_load_multiple
(
$fc_ids
);
$new_items
==
$items
;
// Iterate through the fieldable entities again to attach the loaded
// field collection data.
...
...
@@ -1002,7 +1004,7 @@ function field_collection_entity_preload($entities, $langcode, &$items, $fields)
$field_data
=
$e
->
$field_name
;
if
(
isset
(
$field_data
[
$langcode
]))
{
$new_entities
[
$e
->
item_id
]
=
$e
->
item_id
;
$items
[
$e
->
item_id
]
=
$field_data
[
$langcode
];
$
new_
items
[
$e
->
item_id
]
=
$field_data
[
$langcode
];
}
}
}
...
...
@@ -1010,18 +1012,17 @@ function field_collection_entity_preload($entities, $langcode, &$items, $fields)
// Otherwise, unset the instance value, since the field colletion entity
// does not exist.
else
{
unset
(
$items
[
$id
][
$delta
]);
unset
(
$
new_
items
[
$id
][
$delta
]);
$rekey
=
TRUE
;
}
}
if
(
$rekey
)
{
// Rekey the items array.
$items
[
$id
]
=
array_values
(
$items
[
$id
]);
$
new_
items
[
$id
]
=
array_values
(
$
new_
items
[
$id
]);
}
}
field_collection_entity_preload
(
$new_entities
,
$langcode
,
$items
,
$fields
);
field_collection_entity_preload
(
$new_entities
,
$langcode
,
$new_items
,
$fields
);
}
}
...
...
Write
Preview
Supports
Markdown
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