Roll back issue #1400256 ($info['fields'] not always set). It was causing SimpleTest memory problems.

merge-requests/26/head
David Rothstein 2012-07-11 14:16:20 -04:00
parent af049389ee
commit 34ac2b6286
1 changed files with 5 additions and 6 deletions

View File

@ -181,17 +181,17 @@ function _field_info_collate_types($reset = FALSE) {
* whose field is active. * whose field is active.
*/ */
function _field_info_collate_fields($reset = FALSE) { function _field_info_collate_fields($reset = FALSE) {
static $cached_info; static $info;
if ($reset) { if ($reset) {
$cached_info = NULL; $info = NULL;
cache_clear_all('field_info_fields', 'cache_field'); cache_clear_all('field_info_fields', 'cache_field');
return; return;
} }
if (!isset($cached_info)) { if (!isset($info)) {
if ($cached = cache_get('field_info_fields', 'cache_field')) { if ($cached = cache_get('field_info_fields', 'cache_field')) {
$cached_info = $cached->data; $info = $cached->data;
} }
else { else {
$definitions = array( $definitions = array(
@ -243,11 +243,10 @@ function _field_info_collate_fields($reset = FALSE) {
} }
cache_set('field_info_fields', $info, 'cache_field'); cache_set('field_info_fields', $info, 'cache_field');
$cached_info = $info;
} }
} }
return $cached_info; return $info;
} }
/** /**