Commit f92c745d authored by drumm's avatar drumm
Browse files

Issue #3117465: field_attach_load() seems to bail in some conditions, so let’s not use it

parent ecc8b17e
......@@ -78,14 +78,9 @@ function project_usage_retrieve_metadata() {
->entityCondition('bundle', project_project_node_types())
->fieldCondition('field_project_type', 'value', 'full', '=')
->execute();
foreach (project_project_node_types() as $bundle) {
$fields = field_info_instances('node', $bundle);
$machine_name_id[$bundle] = $fields['field_project_machine_name']['field_id'];
}
if (isset($result['node'])) {
foreach (array_chunk($result['node'], 200) as $projects) {
foreach ($projects as $project) {
field_attach_load('node', array($project->nid => $project), FIELD_LOAD_CURRENT, array('field_id' => $machine_name_id[$project->type]));
foreach (array_chunk(array_keys($result['node']), 200) as $project_nids) {
foreach (node_load_multiple($project_nids) as $project) {
$project_name = $project->field_project_machine_name[LANGUAGE_NONE][0]['value'];
$projnames[$project->nid] = $project_name;
$projnids[$project_name] = $project->nid;
......@@ -99,8 +94,8 @@ function project_usage_retrieve_metadata() {
->entityCondition('bundle', project_release_release_node_types())
->execute();
if (isset($result['node'])) {
foreach (array_chunk(array_keys($result['node']), 200) as $releases) {
foreach (node_load_multiple($releases, array(), TRUE) as $release) {
foreach (array_chunk(array_keys($result['node']), 200) as $release_nids) {
foreach (node_load_multiple($release_nids) as $release) {
$project_name = $projnames[$release->field_release_project[LANGUAGE_NONE][0]['target_id']];
$releasedata[$project_name][$release->field_release_version[LANGUAGE_NONE][0]['value']]['release_nid'] = $release->nid;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment