diff --git a/includes/callback_add_aggregation.inc b/includes/callback_add_aggregation.inc index 1c7a7756..069c4107 100644 --- a/includes/callback_add_aggregation.inc +++ b/includes/callback_add_aggregation.inc @@ -203,20 +203,14 @@ public function reduce($a, $b) { return isset($a) ? min($a, $b) : $b; case 'first': return isset($a) ? $a : $b; - case 'last': - return isset($b) ? $b : $a; case 'first_char': $b = "$b"; if (isset($a) || $b === '') { return $a; } return drupal_substr($b, 0, 1); - case 'last_char': - $b = "$b"; - if (isset($a) || $b === '') { - return $a; - } - return drupal_substr($b, -1, 1); + case 'last': + return isset($b) ? $b : $a; case 'list': if (!isset($a)) { $a = array(); @@ -295,9 +289,8 @@ protected function getTypes($info = 'name') { 'max' => t('Maximum'), 'min' => t('Minimum'), 'first' => t('First'), - 'last' => t('Last'), 'first_char' => t('First letter'), - 'last_char' => t('Last letter'), + 'last' => t('Last'), 'list' => t('List'), ); case 'type': @@ -308,9 +301,8 @@ protected function getTypes($info = 'name') { 'max' => 'integer', 'min' => 'integer', 'first' => 'string', - 'last' => 'string', 'first_char' => 'string', - 'last_char' => 'string', + 'last' => 'string', 'list' => 'list', ); case 'description': @@ -321,9 +313,8 @@ protected function getTypes($info = 'name') { 'max' => t('The Maximum aggregation computes the numerically largest contained field value.'), 'min' => t('The Minimum aggregation computes the numerically smallest contained field value.'), 'first' => t('The First aggregation will simply keep the first encountered field value. This is helpful foremost when you know that a list field will only have a single value.'), - 'last' => t('The Last aggregation will simply keep the last encountered field value.'), 'first_char' => t('The "First letter" aggregation uses just the first letter of the first encountered field value as the aggregated value. This can, for example, be used to build a Glossary view.'), - 'last_char' => t('The "Last letter" aggregation uses just the last letter of the first encountered field value as the aggregated value.'), + 'last' => t('The Last aggregation will simply keep the last encountered field value.'), 'list' => t('The List aggregation collects all field values into a multi-valued field containing all values.'), ); }