Skip to content

Commit

Permalink
Store only the numbers in the cache instead of the entire string.
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-vessey committed Jan 7, 2015
1 parent cbe8ebf commit faa3ca8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions includes/blocks.inc
Expand Up @@ -77,7 +77,7 @@ function islandora_basic_collection_object_count_callback() {
$cid = islandora_basic_collection_get_object_count_block_cache_id();

if ($value = cache_get($cid, 'cache')) {
$text = $value->data;
$substitutions = $value->data;
}
else {
$tuque = islandora_get_tuque_connection();
Expand All @@ -104,15 +104,15 @@ function islandora_basic_collection_object_count_callback() {
}
$total_collection_count = count($collections);

$title_phrase = variable_get('islandora_basic_collection_object_count_listing_phrase', '!objects Items in !collections Collections');

$text = format_string($title_phrase, array(
$substitutions = array(
'!objects' => $total_object_count,
'!collections' => $total_collection_count,
));
cache_set($cid, $text, 'cache');
);
cache_set($cid, $substitutions, 'cache');
}

$title_phrase = variable_get('islandora_basic_collection_object_count_listing_phrase', '!objects Items in !collections Collections');
$text = format_string($title_phrase, $substitutions);
drupal_json_output($text);
}

Expand Down

0 comments on commit faa3ca8

Please sign in to comment.