Issue #1922892 by yched: Last missing bit from D7 '_field_info_collate_fields()' patch.
parent
0c53c63af4
commit
17f76e227d
|
@ -1349,11 +1349,6 @@ function hook_field_storage_details_alter(&$details, $field) {
|
|||
* Modules implementing this hook should load field values and add them to
|
||||
* objects in $entities. Fields with no values should be added as empty arrays.
|
||||
*
|
||||
* By the time this hook runs, the relevant field definitions have been
|
||||
* populated and cached in FieldInfo, so calling field_info_field_by_id() on
|
||||
* each field individually is more efficient than loading all fields in memory
|
||||
* upfront with field_info_field_by_ids() (which is uncached).
|
||||
*
|
||||
* @param $entity_type
|
||||
* The type of entity, such as 'node' or 'user'.
|
||||
* @param $entities
|
||||
|
@ -1374,6 +1369,10 @@ function hook_field_storage_load($entity_type, $entities, $age, $fields, $option
|
|||
$load_current = $age == FIELD_LOAD_CURRENT;
|
||||
|
||||
foreach ($fields as $field_id => $ids) {
|
||||
// By the time this hook runs, the relevant field definitions have been
|
||||
// populated and cached in FieldInfo, so calling field_info_field_by_id()
|
||||
// on each field individually is more efficient than loading all fields in
|
||||
// memory upfront with field_info_field_by_ids().
|
||||
$field = field_info_field_by_id($field_id);
|
||||
$field_name = $field['field_name'];
|
||||
$table = $load_current ? _field_sql_storage_tablename($field) : _field_sql_storage_revision_tablename($field);
|
||||
|
|
|
@ -356,6 +356,10 @@ function field_sql_storage_field_storage_load($entity_type, $entities, $age, $fi
|
|||
$load_current = $age == FIELD_LOAD_CURRENT;
|
||||
|
||||
foreach ($fields as $field_id => $ids) {
|
||||
// By the time this hook runs, the relevant field definitions have been
|
||||
// populated and cached in FieldInfo, so calling field_info_field_by_id()
|
||||
// on each field individually is more efficient than loading all fields in
|
||||
// memory upfront with field_info_field_by_ids().
|
||||
$field = field_info_field_by_id($field_id);
|
||||
$field_name = $field['field_name'];
|
||||
$table = $load_current ? _field_sql_storage_tablename($field) : _field_sql_storage_revision_tablename($field);
|
||||
|
|
Loading…
Reference in New Issue