diff --git a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php index d597c3a..589db1a 100644 --- a/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php +++ b/core/modules/openid/lib/Drupal/openid/Tests/OpenIDFunctionalTest.php @@ -253,7 +253,6 @@ function testDelete() { * Test that a blocked user cannot log in. */ function testBlockedUserLogin() { - module_enable(array('views')); // Use a User-supplied Identity that is the URL of an XRDS document. $identity = url('openid-test/yadis/xrds', array('absolute' => TRUE)); @@ -265,13 +264,9 @@ function testBlockedUserLogin() { // Log in as an admin user and block the account. $admin_user = $this->drupalCreateUser(array('administer users')); $this->drupalLogin($admin_user); - $this->drupalGet('admin/people'); - $edit = array( - 'action' => 'block', - 'user_bulk_form[2]' => TRUE, - ); - $this->drupalPost('admin/people', $edit, t('Apply')); - $this->assertRaw('The update has been performed.', 'Account was blocked.'); + + $this->drupalPost("user/{$this->web_user->id()}/cancel", array(), t('Cancel account')); + $this->assertRaw(t('%user has been disabled.', array('%user' => $this->web_user->name) ), 'Account was blocked.'); $this->drupalLogout(); $this->submitLoginForm($identity); diff --git a/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php b/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php index d662038..0d0972c 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php +++ b/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php @@ -51,41 +51,48 @@ public function views_form(&$form, &$form_state) { // Add the tableselect javascript. $form['#attached']['library'][] = array('system', 'drupal.tableselect'); - // Render checkboxes for all rows. - $form[$this->options['id']]['#tree'] = TRUE; - foreach ($this->view->result as $row_index => $row) { - $form[$this->options['id']][$row_index] = array( - '#type' => 'checkbox', - // We are not able to determine a main "title" for each row, so we can - // only output a generic label. - '#title' => t('Update this item'), - '#title_display' => 'invisible', - '#default_value' => !empty($form_state['values'][$this->options['id']][$row_index]) ? 1 : NULL, + // Only add the bulk form options and buttons if there are results. + if (!empty($this->view->result)) { + // Render checkboxes for all rows. + $form[$this->options['id']]['#tree'] = TRUE; + foreach ($this->view->result as $row_index => $row) { + $form[$this->options['id']][$row_index] = array( + '#type' => 'checkbox', + // We are not able to determine a main "title" for each row, so we can + // only output a generic label. + '#title' => t('Update this item'), + '#title_display' => 'invisible', + '#default_value' => !empty($form_state['values'][$this->options['id']][$row_index]) ? 1 : NULL, + ); + } + + // Replace the form submit button label. + $form['actions']['submit']['#value'] = t('Apply'); + + // Ensure a consistent container for filters/operations in the view header. + $form['header'] = array( + '#type' => 'container', + '#weight' => -100, + ); + + // Build the bulk operations action widget for the header. + // Allow themes to apply .container-inline on this separate container. + $form['header'][$this->options['id']] = array( + '#type' => 'container', + ); + $form['header'][$this->options['id']]['action'] = array( + '#type' => 'select', + '#title' => t('With selection'), + '#options' => $this->getBulkOptions(), ); - } - // Replace the form submit button label. - $form['actions']['submit']['#value'] = t('Apply'); - - // Ensure a consistent container for filters/operations in the view header. - $form['header'] = array( - '#type' => 'container', - '#weight' => -100, - ); - - // Build the bulk operations action widget for the header. - // Allow themes to apply .container-inline on this separate container. - $form['header'][$this->options['id']] = array( - '#type' => 'container', - ); - $form['header'][$this->options['id']]['action'] = array( - '#type' => 'select', - '#title' => t('With selection'), - '#options' => $this->getBulkOptions(), - ); - - // Duplicate the form actions into the action container in the header. - $form['header'][$this->options['id']]['actions'] = $form['actions']; + // Duplicate the form actions into the action container in the header. + $form['header'][$this->options['id']]['actions'] = $form['actions']; + } + else { + // Remove the default actions build array. + unset($form['actions']); + } } /** diff --git a/core/modules/user/config/views.view.people.yml b/core/modules/user/config/views.view.people.yml index abdb048..28f6ba7 100644 --- a/core/modules/user/config/views.view.people.yml +++ b/core/modules/user/config/views.view.people.yml @@ -4,6 +4,26 @@ core: 8.x description: 'Find and manage people interacting with your site.' status: '1' display: + page_1: + display_plugin: page + id: page_1 + display_title: Page + position: '' + display_options: + path: admin/people/list + menu: + type: 'default tab' + title: List + description: 'Find and manage people interacting with your site.' + name: admin + weight: '-10' + context: '0' + tab_options: + type: normal + title: People + description: 'Manage user accounts, roles, and permissions.' + name: admin + weight: '0' default: display_plugin: default id: default @@ -100,6 +120,7 @@ display: empty_column: '0' responsive: '' default: created + empty_table: '1' row: type: fields fields: @@ -189,7 +210,7 @@ display: exposed: '1' expose: operator_id: rid_op - label: Roles + label: Role operator: rid_op identifier: role plugin_id: user_roles @@ -227,6 +248,8 @@ display: field: uid_raw operator: '!=' value: + min: '' + max: '' value: '0' group: '1' exposed: '0' @@ -240,35 +263,16 @@ display: plugin_id: date title: People empty: - area: - id: area + area_text_custom: + id: area_text_custom table: views - field: area + field: area_text_custom empty: '1' content: 'No people available.' - format: filtered_html - plugin_id: area - page_1: - display_plugin: page - id: page_1 - display_title: Page - position: '' - display_options: - path: admin/people/people - menu: - type: 'default tab' - title: List - description: 'Find and manage people interacting with your site.' - name: admin - weight: '0' - context: '0' - tab_options: - type: normal - title: People - description: 'Manage user accounts, roles, and permissions.' - name: admin - weight: '0' + plugin_id: text_custom human_name: People module: views id: people tag: default +uuid: '' +langcode: und diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/UserBulkForm.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/UserBulkForm.php index 0cea647..e659078 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/field/UserBulkForm.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/UserBulkForm.php @@ -26,7 +26,7 @@ class UserBulkForm extends BulkFormBase { protected function getBulkOptions() { return array_map(function($operation) { return $operation['label']; - }, drupal_container()->get('module_handler')->invokeAll('user_operations')); + }, \Drupal::moduleHandler()->invokeAll('user_operations')); } /** @@ -58,7 +58,7 @@ public function views_form_submit(&$form, &$form_state) { return; } - $operations = drupal_container()->get('module_handler')->invokeAll('user_operations', array($form_state['values']['action'])); + $operations = \Drupal::moduleHandler()->invokeAll('user_operations', array($form_state['values']['action'])); $operation = $operations[$form_state['values']['action']]; // Filter out unchecked accounts. if ($function = $operation['callback']) {