From fa69f7f2816bbce2e4f3c3adbbf96f737b603fb4 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Mon, 4 Mar 2013 15:31:26 +0000 Subject: [PATCH] Issue #1922396 by damiankloip: Add groupable_only() parameter to DisplayPluginBase::getFieldLabels(). --- .../views/display/DisplayPluginBase.php | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index ea0c954b289f..325981596ee2 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -894,20 +894,18 @@ public function getHandlers($type) { } /** - * Retrieve a list of fields for the current display with the - * relationship associated if it exists. + * Retrieves a list of fields for the current display. * - * @param $groupable_only - * Return only an array of field labels from handler that return TRUE - * from use_string_group_by method. + * This also takes into account any associated relationships, if they exist. + * + * @param bool $groupable_only + * (optional) TRUE to only return an array of field labels from handlers + * that support the use_string_group_by method, defaults to FALSE. + * + * @return array + * An array of applicable field options, keyed by ID. */ - public function getFieldLabels() { - // Use func_get_arg so the function signature isn't amended - // but we can still pass TRUE into the function to filter - // by groupable handlers. - $args = func_get_args(); - $groupable_only = isset($args[0]) ? $args[0] : FALSE; - + public function getFieldLabels($groupable_only = FALSE) { $options = array(); foreach ($this->getHandlers('relationship') as $relationship => $handler) { if ($label = $handler->label()) { -- GitLab