diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php index 3f510aa..2acd0b1 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php @@ -275,7 +275,7 @@ public function buildOptionsForm(&$form, &$form_state) { // be moved into one because of the form_state['values'] hierarchy. Those // elements can add a #fieldset => 'fieldset_name' property, and they'll // be moved to their fieldset during pre_render. - $form['#pre_render'][] = 'views_ui_pre_render_add_fieldset_markup'; + $form['#pre_render'][] = array($this, 'preRenderAddFieldsetMarkup'); $form['admin_label'] = array( '#type' => 'textfield', diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php index c813c4f..07c751d 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php @@ -332,20 +332,26 @@ public function globalTokenForm(&$form, &$form_state) { } /** - * Pre render: Move form elements into details for presentation purposes. + * Moves form elements into fieldsets for presentation purposes. * * Many views forms use #tree = TRUE to keep their values in a hierarchy for - * easier storage. Moving the form elements into fieldsets during form building - * would break up that hierarchy. Therefore, we wait until the pre_render stage, - * where any changes we make affect presentation only and aren't reflected in - * $form_state['values']. + * easier storage. Moving the form elements into fieldsets during form + * building would break up that hierarchy. Therefore, we wait until the + * pre_render stage, where any changes we make affect presentation only and + * aren't reflected in $form_state['values']. + * + * @param array $form + * The form build array to alter. + * + * @return array + * The form build array. */ - public function preRenderAddFieldsetMarkup($form) { + public function preRenderAddFieldsetMarkup(array $form) { foreach (element_children($form) as $key) { $element = $form[$key]; // In our form builder functions, we added an arbitrary #fieldset property - // to any element that belongs in a fieldset. If this form element has that - // property, move it into its fieldset. + // to any element that belongs in a fieldset. If this form element has + // that property, move it into its fieldset. if (isset($element['#fieldset']) && isset($form[$element['#fieldset']])) { $form[$element['#fieldset']][$key] = $element; // Remove the original element this duplicates. @@ -357,12 +363,17 @@ public function preRenderAddFieldsetMarkup($form) { } /** - * Flattens the structure of an element containing the #flatten property. + * Flattens the structure of form elements. * - * If a form element has #flatten = TRUE, then all of it's children - * get moved to the same level as the element itself. - * So $form['to_be_flattened'][$key] becomes $form[$key], and - * $form['to_be_flattened'] gets unset. + * If a form element has #flatten = TRUE, then all of it's children get moved + * to the same level as the element itself. So $form['to_be_flattened'][$key] + * becomes $form[$key], and $form['to_be_flattened'] gets unset. + * + * @param array $form + * The form build array to alter. + * + * @return array + * The form build array. */ public function preRenderFlattenData($form) { foreach (element_children($form) as $key) {