Commit 68649cf8 authored by webchick's avatar webchick

Issue #2471010 by pguillard, Arez, Oleksiy, ifrik, yoroy, andypost, alexpott,...

Issue #2471010 by pguillard, Arez, Oleksiy, ifrik, yoroy, andypost, alexpott, Bojhan, jbguerraz, brahmjeet789, jaimeguzman, drubb, DuaelFr, lrmeeske, Gábor Hojtsy: Label for Content and User bulk operations does not fit the action
parent 0745511b
...@@ -68,7 +68,7 @@ public function testBulkForm() { ...@@ -68,7 +68,7 @@ public function testBulkForm() {
// Set all nodes to sticky and check that. // Set all nodes to sticky and check that.
$edit += array('action' => 'node_make_sticky_action'); $edit += array('action' => 'node_make_sticky_action');
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
foreach ($nodes as $node) { foreach ($nodes as $node) {
$changed_node = $node_storage->load($node->id()); $changed_node = $node_storage->load($node->id());
...@@ -82,7 +82,7 @@ public function testBulkForm() { ...@@ -82,7 +82,7 @@ public function testBulkForm() {
$this->assertTrue($node->isPublished(), 'The node is published.'); $this->assertTrue($node->isPublished(), 'The node is published.');
$edit = array('node_bulk_form[0]' => TRUE, 'action' => 'node_unpublish_action'); $edit = array('node_bulk_form[0]' => TRUE, 'action' => 'node_unpublish_action');
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$this->assertText('Unpublish content was applied to 1 item.'); $this->assertText('Unpublish content was applied to 1 item.');
...@@ -123,7 +123,7 @@ public function testBulkForm() { ...@@ -123,7 +123,7 @@ public function testBulkForm() {
// Check the default title. // Check the default title.
$this->drupalGet('test_bulk_form'); $this->drupalGet('test_bulk_form');
$result = $this->xpath('//label[@for="edit-action"]'); $result = $this->xpath('//label[@for="edit-action"]');
$this->assertEqual('With selection', $result[0]->getText()); $this->assertEqual('Action', $result[0]->getText());
// Setup up a different bulk form title. // Setup up a different bulk form title.
$view = Views::getView('test_bulk_form'); $view = Views::getView('test_bulk_form');
...@@ -142,7 +142,7 @@ public function testBulkForm() { ...@@ -142,7 +142,7 @@ public function testBulkForm() {
$edit["node_bulk_form[$i]"] = TRUE; $edit["node_bulk_form[$i]"] = TRUE;
} }
$edit += array('action' => 'node_delete_action'); $edit += array('action' => 'node_delete_action');
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
// Make sure we don't show an action message while we are still on the // Make sure we don't show an action message while we are still on the
// confirmation page. // confirmation page.
$errors = $this->xpath('//div[contains(@class, "messages--status")]'); $errors = $this->xpath('//div[contains(@class, "messages--status")]');
......
...@@ -87,7 +87,7 @@ public function testNodeEditAccess() { ...@@ -87,7 +87,7 @@ public function testNodeEditAccess() {
'node_bulk_form[0]' => TRUE, 'node_bulk_form[0]' => TRUE,
'action' => 'node_unpublish_action', 'action' => 'node_unpublish_action',
); );
$this->drupalPostForm('test-node-bulk-form', $edit, t('Apply')); $this->drupalPostForm('test-node-bulk-form', $edit, t('Apply to selected items'));
$this->assertRaw(SafeMarkup::format('No access to execute %action on the @entity_type_label %entity_label.', [ $this->assertRaw(SafeMarkup::format('No access to execute %action on the @entity_type_label %entity_label.', [
'%action' => 'Unpublish content', '%action' => 'Unpublish content',
'@entity_type_label' => 'Content', '@entity_type_label' => 'Content',
...@@ -115,7 +115,7 @@ public function testNodeEditAccess() { ...@@ -115,7 +115,7 @@ public function testNodeEditAccess() {
'node_bulk_form[0]' => TRUE, 'node_bulk_form[0]' => TRUE,
'action' => 'node_unpublish_action', 'action' => 'node_unpublish_action',
); );
$this->drupalPostForm('test-node-bulk-form', $edit, t('Apply')); $this->drupalPostForm('test-node-bulk-form', $edit, t('Apply to selected items'));
// Re-load the node and check the status. // Re-load the node and check the status.
$node = Node::load($node->id()); $node = Node::load($node->id());
$this->assertTrue($node->isPublished(), 'The node is still published.'); $this->assertTrue($node->isPublished(), 'The node is still published.');
...@@ -160,7 +160,7 @@ public function testNodeDeleteAccess() { ...@@ -160,7 +160,7 @@ public function testNodeDeleteAccess() {
'node_bulk_form[1]' => TRUE, 'node_bulk_form[1]' => TRUE,
'action' => 'node_delete_action', 'action' => 'node_delete_action',
); );
$this->drupalPostForm('test-node-bulk-form', $edit, t('Apply')); $this->drupalPostForm('test-node-bulk-form', $edit, t('Apply to selected items'));
$this->drupalPostForm(NULL, array(), t('Delete')); $this->drupalPostForm(NULL, array(), t('Delete'));
// Ensure the private node still exists. // Ensure the private node still exists.
$private_node = Node::load($private_node->id()); $private_node = Node::load($private_node->id());
......
...@@ -105,7 +105,7 @@ public function testBulkForm() { ...@@ -105,7 +105,7 @@ public function testBulkForm() {
'node_bulk_form[0]' => TRUE, 'node_bulk_form[0]' => TRUE,
'action' => 'node_unpublish_action', 'action' => 'node_unpublish_action',
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$node = $this->loadNode($node->id()); $node = $this->loadNode($node->id());
$this->assertFalse($node->isPublished(), 'Node has been unpublished'); $this->assertFalse($node->isPublished(), 'Node has been unpublished');
$this->assertTrue($node->getTranslation('en-gb')->isPublished(), 'Node translation has not been unpublished'); $this->assertTrue($node->getTranslation('en-gb')->isPublished(), 'Node translation has not been unpublished');
...@@ -116,7 +116,7 @@ public function testBulkForm() { ...@@ -116,7 +116,7 @@ public function testBulkForm() {
'node_bulk_form[0]' => TRUE, 'node_bulk_form[0]' => TRUE,
'action' => 'node_publish_action', 'action' => 'node_publish_action',
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$node = $this->loadNode($node->id()); $node = $this->loadNode($node->id());
$this->assertTrue($node->isPublished(), 'Node has been published again'); $this->assertTrue($node->isPublished(), 'Node has been published again');
...@@ -128,7 +128,7 @@ public function testBulkForm() { ...@@ -128,7 +128,7 @@ public function testBulkForm() {
'node_bulk_form[0]' => TRUE, 'node_bulk_form[0]' => TRUE,
'action' => 'node_make_sticky_action', 'action' => 'node_make_sticky_action',
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$node = $this->loadNode($node->id()); $node = $this->loadNode($node->id());
$this->assertTrue($node->isSticky(), 'Node has been made sticky'); $this->assertTrue($node->isSticky(), 'Node has been made sticky');
$this->assertFalse($node->getTranslation('en-gb')->isSticky(), 'Node translation has not been made sticky'); $this->assertFalse($node->getTranslation('en-gb')->isSticky(), 'Node translation has not been made sticky');
...@@ -139,7 +139,7 @@ public function testBulkForm() { ...@@ -139,7 +139,7 @@ public function testBulkForm() {
'node_bulk_form[0]' => TRUE, 'node_bulk_form[0]' => TRUE,
'action' => 'node_make_unsticky_action', 'action' => 'node_make_unsticky_action',
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$node = $this->loadNode($node->id()); $node = $this->loadNode($node->id());
$this->assertFalse($node->isSticky(), 'Node is not sticky anymore'); $this->assertFalse($node->isSticky(), 'Node is not sticky anymore');
...@@ -151,7 +151,7 @@ public function testBulkForm() { ...@@ -151,7 +151,7 @@ public function testBulkForm() {
'node_bulk_form[0]' => TRUE, 'node_bulk_form[0]' => TRUE,
'action' => 'node_promote_action', 'action' => 'node_promote_action',
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$node = $this->loadNode($node->id()); $node = $this->loadNode($node->id());
$this->assertTrue($node->isPromoted(), 'Node has been promoted to the front page'); $this->assertTrue($node->isPromoted(), 'Node has been promoted to the front page');
$this->assertFalse($node->getTranslation('en-gb')->isPromoted(), 'Node translation has not been promoted to the front page'); $this->assertFalse($node->getTranslation('en-gb')->isPromoted(), 'Node translation has not been promoted to the front page');
...@@ -162,7 +162,7 @@ public function testBulkForm() { ...@@ -162,7 +162,7 @@ public function testBulkForm() {
'node_bulk_form[0]' => TRUE, 'node_bulk_form[0]' => TRUE,
'action' => 'node_unpromote_action', 'action' => 'node_unpromote_action',
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$node = $this->loadNode($node->id()); $node = $this->loadNode($node->id());
$this->assertFalse($node->isPromoted(), 'Node has been demoted'); $this->assertFalse($node->isPromoted(), 'Node has been demoted');
...@@ -185,7 +185,7 @@ public function testBulkForm() { ...@@ -185,7 +185,7 @@ public function testBulkForm() {
'node_bulk_form[9]' => FALSE, // Node 5, British English, untranslated. 'node_bulk_form[9]' => FALSE, // Node 5, British English, untranslated.
'action' => 'node_unpublish_action', 'action' => 'node_unpublish_action',
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$node = $this->loadNode(1); $node = $this->loadNode(1);
$this->assertFalse($node->getTranslation('en')->isPublished(), '1: English translation has been unpublished'); $this->assertFalse($node->getTranslation('en')->isPublished(), '1: English translation has been unpublished');
$this->assertFalse($node->getTranslation('en-gb')->isPublished(), '1: British English translation has been unpublished'); $this->assertFalse($node->getTranslation('en-gb')->isPublished(), '1: British English translation has been unpublished');
...@@ -226,7 +226,7 @@ public function testBulkDeletion() { ...@@ -226,7 +226,7 @@ public function testBulkDeletion() {
'node_bulk_form[9]' => FALSE, // Node 5, British English, untranslated. 'node_bulk_form[9]' => FALSE, // Node 5, British English, untranslated.
'action' => 'node_delete_action', 'action' => 'node_delete_action',
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$label = $this->loadNode(1)->label(); $label = $this->loadNode(1)->label();
$this->assertText("$label (Original translation) - The following content translations will be deleted:"); $this->assertText("$label (Original translation) - The following content translations will be deleted:");
......
...@@ -162,7 +162,7 @@ protected function getView() { ...@@ -162,7 +162,7 @@ protected function getView() {
*/ */
protected function defineOptions() { protected function defineOptions() {
$options = parent::defineOptions(); $options = parent::defineOptions();
$options['action_title'] = array('default' => $this->t('With selection')); $options['action_title'] = array('default' => $this->t('Action'));
$options['include_exclude'] = array( $options['include_exclude'] = array(
'default' => 'exclude', 'default' => 'exclude',
); );
...@@ -271,7 +271,7 @@ public function viewsForm(&$form, FormStateInterface $form_state) { ...@@ -271,7 +271,7 @@ public function viewsForm(&$form, FormStateInterface $form_state) {
} }
// Replace the form submit button label. // Replace the form submit button label.
$form['actions']['submit']['#value'] = $this->t('Apply'); $form['actions']['submit']['#value'] = $this->t('Apply to selected items');
// Ensure a consistent container for filters/operations in the view header. // Ensure a consistent container for filters/operations in the view header.
$form['header'] = array( $form['header'] = array(
......
...@@ -412,7 +412,7 @@ function testTrackerAdminUnpublish() { ...@@ -412,7 +412,7 @@ function testTrackerAdminUnpublish() {
'action' => 'node_unpublish_action', 'action' => 'node_unpublish_action',
'node_bulk_form[0]' => $node->id(), 'node_bulk_form[0]' => $node->id(),
); );
$this->drupalPostForm('admin/content', $edit, t('Apply')); $this->drupalPostForm('admin/content', $edit, t('Apply to selected items'));
$this->drupalGet('activity'); $this->drupalGet('activity');
$this->assertText(t('No content available.'), 'A node is displayed on the tracker listing pages.'); $this->assertText(t('No content available.'), 'A node is displayed on the tracker listing pages.');
......
...@@ -100,7 +100,7 @@ function testUserAdmin() { ...@@ -100,7 +100,7 @@ function testUserAdmin() {
$config $config
->set('notify.status_blocked', TRUE) ->set('notify.status_blocked', TRUE)
->save(); ->save();
$this->drupalPostForm('admin/people', $edit, t('Apply'), array( $this->drupalPostForm('admin/people', $edit, t('Apply to selected items'), array(
// Sort the table by username so that we know reliably which user will be // Sort the table by username so that we know reliably which user will be
// targeted with the blocking action. // targeted with the blocking action.
'query' => array('order' => 'name', 'sort' => 'asc') 'query' => array('order' => 'name', 'sort' => 'asc')
...@@ -121,7 +121,7 @@ function testUserAdmin() { ...@@ -121,7 +121,7 @@ function testUserAdmin() {
$editunblock = array(); $editunblock = array();
$editunblock['action'] = 'user_unblock_user_action'; $editunblock['action'] = 'user_unblock_user_action';
$editunblock['user_bulk_form[4]'] = TRUE; $editunblock['user_bulk_form[4]'] = TRUE;
$this->drupalPostForm('admin/people', $editunblock, t('Apply'), array( $this->drupalPostForm('admin/people', $editunblock, t('Apply to selected items'), array(
// Sort the table by username so that we know reliably which user will be // Sort the table by username so that we know reliably which user will be
// targeted with the blocking action. // targeted with the blocking action.
'query' => array('order' => 'name', 'sort' => 'asc') 'query' => array('order' => 'name', 'sort' => 'asc')
......
...@@ -124,7 +124,7 @@ function testUserCancelUid1() { ...@@ -124,7 +124,7 @@ function testUserCancelUid1() {
'action' => 'user_cancel_user_action', 'action' => 'user_cancel_user_action',
'user_bulk_form[0]' => TRUE, 'user_bulk_form[0]' => TRUE,
); );
$this->drupalPostForm('admin/people', $edit, t('Apply')); $this->drupalPostForm('admin/people', $edit, t('Apply to selected items'));
// Verify that uid 1's account was not cancelled. // Verify that uid 1's account was not cancelled.
$user_storage->resetCache(array(1)); $user_storage->resetCache(array(1));
...@@ -567,7 +567,7 @@ function testMassUserCancelByAdmin() { ...@@ -567,7 +567,7 @@ function testMassUserCancelByAdmin() {
for ($i = 0; $i <= 4; $i++) { for ($i = 0; $i <= 4; $i++) {
$edit['user_bulk_form[' . $i . ']'] = TRUE; $edit['user_bulk_form[' . $i . ']'] = TRUE;
} }
$this->drupalPostForm('admin/people', $edit, t('Apply')); $this->drupalPostForm('admin/people', $edit, t('Apply to selected items'));
$this->assertText(t('Are you sure you want to cancel these user accounts?'), 'Confirmation form to cancel accounts displayed.'); $this->assertText(t('Are you sure you want to cancel these user accounts?'), 'Confirmation form to cancel accounts displayed.');
$this->assertText(t('When cancelling these accounts'), 'Allows to select account cancellation method.'); $this->assertText(t('When cancelling these accounts'), 'Allows to select account cancellation method.');
$this->assertText(t('Require email confirmation to cancel account'), 'Allows to send confirmation mail.'); $this->assertText(t('Require email confirmation to cancel account'), 'Allows to send confirmation mail.');
......
...@@ -50,7 +50,7 @@ public function testUserEditAccess() { ...@@ -50,7 +50,7 @@ public function testUserEditAccess() {
'user_bulk_form[' . ($no_edit_user->id() - 1) . ']' => TRUE, 'user_bulk_form[' . ($no_edit_user->id() - 1) . ']' => TRUE,
'action' => 'user_block_user_action', 'action' => 'user_block_user_action',
); );
$this->drupalPostForm('test-user-bulk-form', $edit, t('Apply')); $this->drupalPostForm('test-user-bulk-form', $edit, t('Apply to selected items'));
$this->assertResponse(200); $this->assertResponse(200);
$this->assertRaw(SafeMarkup::format('No access to execute %action on the @entity_type_label %entity_label.', [ $this->assertRaw(SafeMarkup::format('No access to execute %action on the @entity_type_label %entity_label.', [
...@@ -71,7 +71,7 @@ public function testUserEditAccess() { ...@@ -71,7 +71,7 @@ public function testUserEditAccess() {
'user_bulk_form[' . ($normal_user->id() - 1) . ']' => TRUE, 'user_bulk_form[' . ($normal_user->id() - 1) . ']' => TRUE,
'action' => 'user_block_user_action', 'action' => 'user_block_user_action',
); );
$this->drupalPostForm('test-user-bulk-form', $edit, t('Apply')); $this->drupalPostForm('test-user-bulk-form', $edit, t('Apply to selected items'));
$normal_user = User::load($normal_user->id()); $normal_user = User::load($normal_user->id());
$this->assertTrue($normal_user->isBlocked(), 'The user is blocked.'); $this->assertTrue($normal_user->isBlocked(), 'The user is blocked.');
...@@ -83,7 +83,7 @@ public function testUserEditAccess() { ...@@ -83,7 +83,7 @@ public function testUserEditAccess() {
'user_bulk_form[' . ($normal_user->id() - 1) . ']' => TRUE, 'user_bulk_form[' . ($normal_user->id() - 1) . ']' => TRUE,
'action' => 'user_unblock_user_action', 'action' => 'user_unblock_user_action',
); );
$this->drupalPostForm('test-user-bulk-form', $edit, t('Apply')); $this->drupalPostForm('test-user-bulk-form', $edit, t('Apply to selected items'));
// Re-load the normal user and ensure it is still blocked. // Re-load the normal user and ensure it is still blocked.
$normal_user = User::load($normal_user->id()); $normal_user = User::load($normal_user->id());
...@@ -114,7 +114,7 @@ public function testUserDeleteAccess() { ...@@ -114,7 +114,7 @@ public function testUserDeleteAccess() {
'user_bulk_form[' . ($account2->id() - 1) . ']' => TRUE, 'user_bulk_form[' . ($account2->id() - 1) . ']' => TRUE,
'action' => 'user_cancel_user_action', 'action' => 'user_cancel_user_action',
); );
$this->drupalPostForm('test-user-bulk-form', $edit, t('Apply')); $this->drupalPostForm('test-user-bulk-form', $edit, t('Apply to selected items'));
$edit = array( $edit = array(
'user_cancel_method' => 'user_cancel_delete', 'user_cancel_method' => 'user_cancel_delete',
); );
......
...@@ -46,7 +46,7 @@ public function testBulkForm() { ...@@ -46,7 +46,7 @@ public function testBulkForm() {
$edit = array( $edit = array(
'action' => 'user_block_user_action', 'action' => 'user_block_user_action',
); );
$this->drupalPostForm('test-user-bulk-form', $edit, t('Apply')); $this->drupalPostForm('test-user-bulk-form', $edit, t('Apply to selected items'));
$this->assertText(t('No users selected.')); $this->assertText(t('No users selected.'));
// Assign a role to a user. // Assign a role to a user.
...@@ -60,7 +60,7 @@ public function testBulkForm() { ...@@ -60,7 +60,7 @@ public function testBulkForm() {
'user_bulk_form[1]' => TRUE, 'user_bulk_form[1]' => TRUE,
'action' => 'user_add_role_action.' . $role, 'action' => 'user_add_role_action.' . $role,
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
// Re-load the user and check their roles. // Re-load the user and check their roles.
$user_storage->resetCache(array($account->id())); $user_storage->resetCache(array($account->id()));
$account = $user_storage->load($account->id()); $account = $user_storage->load($account->id());
...@@ -70,7 +70,7 @@ public function testBulkForm() { ...@@ -70,7 +70,7 @@ public function testBulkForm() {
'user_bulk_form[1]' => TRUE, 'user_bulk_form[1]' => TRUE,
'action' => 'user_remove_role_action.' . $role, 'action' => 'user_remove_role_action.' . $role,
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
// Re-load the user and check their roles. // Re-load the user and check their roles.
$user_storage->resetCache(array($account->id())); $user_storage->resetCache(array($account->id()));
$account = $user_storage->load($account->id()); $account = $user_storage->load($account->id());
...@@ -83,7 +83,7 @@ public function testBulkForm() { ...@@ -83,7 +83,7 @@ public function testBulkForm() {
'user_bulk_form[1]' => TRUE, 'user_bulk_form[1]' => TRUE,
'action' => 'user_block_user_action', 'action' => 'user_block_user_action',
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
// Re-load the user and check their status. // Re-load the user and check their status.
$user_storage->resetCache(array($account->id())); $user_storage->resetCache(array($account->id()));
$account = $user_storage->load($account->id()); $account = $user_storage->load($account->id());
...@@ -104,7 +104,7 @@ public function testBulkForm() { ...@@ -104,7 +104,7 @@ public function testBulkForm() {
'user_bulk_form[0]' => TRUE, 'user_bulk_form[0]' => TRUE,
'action' => 'user_block_user_action', 'action' => 'user_block_user_action',
); );
$this->drupalPostForm(NULL, $edit, t('Apply')); $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
$anonymous_account = $user_storage->load(0); $anonymous_account = $user_storage->load(0);
$this->assertTrue($anonymous_account->isBlocked(), 'Ensure the anonymous user got blocked.'); $this->assertTrue($anonymous_account->isBlocked(), 'Ensure the anonymous user got blocked.');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment