diff --git a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php index 7fe32c3..7d96c4a 100644 --- a/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php +++ b/core/modules/views/src/Plugin/views/relationship/GroupwiseMax.php @@ -86,6 +86,7 @@ public function buildOptionsForm(&$form, &$form_state) { // Get the sorts that apply to our base. $sorts = Views::viewsDataHelper()->fetchFields($this->definition['base'], 'sort'); + $sort_options = array(); foreach ($sorts as $sort_id => $sort) { $sort_options[$sort_id] = "$sort[group]: $sort[title]"; } @@ -121,20 +122,14 @@ public function buildOptionsForm(&$form, &$form_state) { // WIP: This stuff doens't work yet: namespacing issues. // A list of suitable views to pick one as the subview. $views = array('' => '- None -'); - $all_views = Views::getAllViews(); - foreach ($all_views as $view) { + foreach (Views::getAllViews() as $view) { // Only get views that are suitable: // - base must the base that our relationship joins towards // - must have fields. if ($view->get('base_table') == $this->definition['base'] && !empty($view->getDisplay('default')['display_options']['fields'])) { // TODO: check the field is the correct sort? // or let users hang themselves at this stage and check later? - if ($view->get('tag') == 'default') { - $views[t('Default Views')][$view->id()] = $view->id(); - } - else { - $views[t('Existing Views')][$view->id()] = $view->id(); - } + $views[$view->id()] = $view->id(); } } @@ -175,6 +170,7 @@ public function submitOptionsForm(&$form, &$form_state) { /** * Generate a subquery given the user options, as set in the options. + * * These are passed in rather than picked up from the object because we * generate the subquery when the options are saved, rather than when the view * is run. This saves considerable time. @@ -183,7 +179,8 @@ public function submitOptionsForm(&$form, &$form_state) { * An array of options: * - subquery_sort: the id of a views sort. * - subquery_order: either ASC or DESC. - * @return + * + * @return string * The subquery SQL string, ready for use in the main query. */ protected function leftQuery($options) {