diff --git a/core/modules/file/src/Tests/FileFieldDisplayTest.php b/core/modules/file/src/Tests/FileFieldDisplayTest.php index 1b11125..6deb3b0 100644 --- a/core/modules/file/src/Tests/FileFieldDisplayTest.php +++ b/core/modules/file/src/Tests/FileFieldDisplayTest.php @@ -65,7 +65,7 @@ function testNodeDisplay() { // Turn the "display" option off and check that the file is no longer displayed. $edit = array($field_name . '[0][display]' => FALSE); - $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Update')); $this->assertNoRaw($default_output, 'Field is hidden when "display" option is unchecked.'); @@ -75,7 +75,7 @@ function testNodeDisplay() { $field_name . '[0][description]' => $description, $field_name . '[0][display]' => TRUE, ); - $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Update')); $this->assertText($description); // Test that fields appear as expected after during the preview. diff --git a/core/modules/file/src/Tests/FileFieldRevisionTest.php b/core/modules/file/src/Tests/FileFieldRevisionTest.php index b45b200..b7a3bf1 100644 --- a/core/modules/file/src/Tests/FileFieldRevisionTest.php +++ b/core/modules/file/src/Tests/FileFieldRevisionTest.php @@ -63,7 +63,7 @@ function testRevisions() { // Save a new version of the node without any changes. // Check that the file is still the same as the previous revision. - $this->drupalPostForm('node/' . $nid . '/edit', array('revision' => '1'), t('Save and keep published')); + $this->drupalPostForm('node/' . $nid . '/edit', array('revision' => '1'), t('Update')); $node = node_load($nid, TRUE); $node_file_r3 = file_load($node->{$field_name}->target_id); $node_vid_r3 = $node->getRevisionId(); diff --git a/core/modules/file/src/Tests/FileFieldTestBase.php b/core/modules/file/src/Tests/FileFieldTestBase.php index 890aa29..0c16b48 100644 --- a/core/modules/file/src/Tests/FileFieldTestBase.php +++ b/core/modules/file/src/Tests/FileFieldTestBase.php @@ -169,7 +169,7 @@ function uploadNodeFile($file, $field_name, $nid_or_type, $new_revision = TRUE, $name .= '[]'; } $edit[$name] = drupal_realpath($file->getFileUri()); - $this->drupalPostForm("node/$nid/edit", $edit, t('Save and keep published')); + $this->drupalPostForm("node/$nid/edit", $edit, t('Update')); return $nid; } @@ -185,7 +185,7 @@ function removeNodeFile($nid, $new_revision = TRUE) { ); $this->drupalPostForm('node/' . $nid . '/edit', array(), t('Remove')); - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Update')); } /** @@ -198,7 +198,7 @@ function replaceNodeFile($file, $field_name, $nid, $new_revision = TRUE) { ); $this->drupalPostForm('node/' . $nid . '/edit', array(), t('Remove')); - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Update')); } /** diff --git a/core/modules/file/src/Tests/FileFieldWidgetTest.php b/core/modules/file/src/Tests/FileFieldWidgetTest.php index 5cc7ab7..88b587f 100644 --- a/core/modules/file/src/Tests/FileFieldWidgetTest.php +++ b/core/modules/file/src/Tests/FileFieldWidgetTest.php @@ -73,7 +73,7 @@ function testSingleValuedWidget() { $this->assertTrue(isset($label[0]), 'Label for upload found.'); // Save the node and ensure it does not have the file. - $this->drupalPostForm(NULL, array(), t('Save and keep published')); + $this->drupalPostForm(NULL, array(), t('Update')); $node = node_load($nid, TRUE); $this->assertTrue(empty($node->{$field_name}->target_id), 'File was successfully removed from the node.'); } @@ -301,7 +301,7 @@ function testPrivateFileComment() { // Unpublishes node. $this->drupalLogin($this->admin_user); - $this->drupalPostForm('node/' . $node->id() . '/edit', array(), t('Save and unpublish')); + $this->drupalPostForm('node/' . $node->id() . '/edit', array(), t('Save draft')); // Ensures normal user can no longer download the file. $this->drupalLogin($user); diff --git a/core/modules/file/src/Tests/FilePrivateTest.php b/core/modules/file/src/Tests/FilePrivateTest.php index 3e69fe4..d5a1f40 100644 --- a/core/modules/file/src/Tests/FilePrivateTest.php +++ b/core/modules/file/src/Tests/FilePrivateTest.php @@ -77,7 +77,7 @@ function testPrivateFile() { $this->drupalPostForm('node/add/' . $type_name, $edit, t('Save and publish')); $new_node = $this->drupalGetNodeByTitle($edit['title[0][value]']); $edit[$field_name . '[0][fids]'] = $node_file->id(); - $this->drupalPostForm('node/' . $new_node->id() .'/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $new_node->id() .'/edit', $edit, t('Update')); // Make sure the form submit failed - we stayed on the edit form. $this->assertUrl('node/' . $new_node->id() .'/edit'); // Check that we got the expected constraint form error. diff --git a/core/modules/forum/src/Tests/ForumIndexTest.php b/core/modules/forum/src/Tests/ForumIndexTest.php index b9ee537..19d812a 100644 --- a/core/modules/forum/src/Tests/ForumIndexTest.php +++ b/core/modules/forum/src/Tests/ForumIndexTest.php @@ -60,7 +60,7 @@ function testForumIndexStatus() { $this->assertText($title, 'Published forum topic appears on index.'); // Unpublish the node. - $this->drupalPostForm('node/' . $node->id() . '/edit', array(), t('Save and unpublish')); + $this->drupalPostForm('node/' . $node->id() . '/edit', array(), t('Save draft')); $this->drupalGet('node/' . $node->id()); $this->assertText(t('Access denied'), 'Unpublished node is no longer accessible.'); diff --git a/core/modules/image/src/Tests/ImageFieldDisplayTest.php b/core/modules/image/src/Tests/ImageFieldDisplayTest.php index c49af3c..35a525e 100644 --- a/core/modules/image/src/Tests/ImageFieldDisplayTest.php +++ b/core/modules/image/src/Tests/ImageFieldDisplayTest.php @@ -219,7 +219,7 @@ function testImageFieldSettings() { $field_name . '[0][alt]' => $image['#alt'], $field_name . '[0][title]' => $image['#title'], ); - $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Update')); $default_output = str_replace("\n", NULL, drupal_render($image)); $this->assertRaw($default_output, 'Image displayed using user supplied alt and title attributes.'); @@ -229,7 +229,7 @@ function testImageFieldSettings() { $field_name . '[0][alt]' => $this->randomMachineName($test_size), $field_name . '[0][title]' => $this->randomMachineName($test_size), ); - $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $nid . '/edit', $edit, t('Update')); $schema = $field->getFieldStorageDefinition()->getSchema(); $this->assertRaw(t('Alternative text cannot be longer than %max characters but is currently %length characters long.', array( '%max' => $schema['columns']['alt']['length'], @@ -250,7 +250,7 @@ function testImageFieldSettings() { $this->drupalPostForm('admin/structure/types/manage/article/fields/node.article.' . $field_name . '/storage', array('field_storage[cardinality]' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED), t('Save field settings')); $edit = array(); $edit['files[' . $field_name . '_1][]'] = drupal_realpath($test_image->uri); - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Update')); $this->assertText(format_string('Article @title has been updated.', array('@title' => $node->getTitle()))); // Assert ImageWidget::process() calls FieldWidget::process(). diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index 7f9ef84..c43cb74 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -226,10 +226,10 @@ protected function actions(array $form, FormStateInterface $form_state) { // 2) the ::save() step, both decoupled from the pressed form button. if ($element['submit']['#access'] && \Drupal::currentUser()->hasPermission('administer nodes')) { // isNew | prev status » default & publish label & unpublish label - // 1 | 1 » publish & Save and publish & Save as unpublished - // 1 | 0 » unpublish & Save and publish & Save as unpublished - // 0 | 1 » publish & Save and keep published & Save and unpublish - // 0 | 0 » unpublish & Save and keep unpublished & Save and publish + // 1 | 1 » publish & Save and publish & Save draft + // 1 | 0 » unpublish & Save and publish & Save draft + // 0 | 1 » publish & Update & Save draft + // 0 | 0 » unpublish & Update draft & Save and publish // Add a "Publish" button. $element['publish'] = $element['submit']; @@ -238,7 +238,7 @@ protected function actions(array $form, FormStateInterface $form_state) { $element['publish']['#value'] = t('Save and publish'); } else { - $element['publish']['#value'] = $node->isPublished() ? t('Save and keep published') : t('Save and publish'); + $element['publish']['#value'] = $node->isPublished() ? t('Update') : t('Save and publish'); } $element['publish']['#weight'] = 0; array_unshift($element['publish']['#submit'], '::publish'); @@ -247,10 +247,10 @@ protected function actions(array $form, FormStateInterface $form_state) { $element['unpublish'] = $element['submit']; $element['unpublish']['#dropbutton'] = 'save'; if ($node->isNew()) { - $element['unpublish']['#value'] = t('Save as unpublished'); + $element['unpublish']['#value'] = t('Save draft'); } else { - $element['unpublish']['#value'] = !$node->isPublished() ? t('Save and keep unpublished') : t('Save and unpublish'); + $element['unpublish']['#value'] = !$node->isPublished() ? t('Update draft') : t('Save draft'); } $element['unpublish']['#weight'] = 10; array_unshift($element['unpublish']['#submit'], '::unpublish'); diff --git a/core/modules/node/src/Tests/NodeFormButtonsTest.php b/core/modules/node/src/Tests/NodeFormButtonsTest.php index cc33ed8..2cc3a08 100644 --- a/core/modules/node/src/Tests/NodeFormButtonsTest.php +++ b/core/modules/node/src/Tests/NodeFormButtonsTest.php @@ -37,7 +37,7 @@ function testNodeFormButtons() { // Verify the buttons on a node add form. $this->drupalGet('node/add/article'); - $this->assertButtons(array(t('Save and publish'), t('Save as unpublished'))); + $this->assertButtons(array(t('Save and publish'), t('Save draft'))); // Save the node and assert it's published after clicking // 'Save and publish'. @@ -50,23 +50,23 @@ function testNodeFormButtons() { // Verify the buttons on a node edit form. $this->drupalGet('node/' . $node_1->id() . '/edit'); - $this->assertButtons(array(t('Save and keep published'), t('Save and unpublish'))); + $this->assertButtons(array(t('Update'), t('Save draft'))); // Save the node and verify it's still published after clicking - // 'Save and keep published'. - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + // 'Update'. + $this->drupalPostForm(NULL, $edit, t('Update')); $node_1 = node_load(1, TRUE); $this->assertTrue($node_1->isPublished(), 'Node is published'); // Save the node and verify it's unpublished after clicking - // 'Save and unpublish'. - $this->drupalPostForm('node/' . $node_1->id() . '/edit', $edit, t('Save and unpublish')); + // 'Save draft'. + $this->drupalPostForm('node/' . $node_1->id() . '/edit', $edit, t('Save draft')); $node_1 = node_load(1, TRUE); $this->assertFalse($node_1->isPublished(), 'Node is unpublished'); // Verify the buttons on an unpublished node edit screen. $this->drupalGet('node/' . $node_1->id() . '/edit'); - $this->assertButtons(array(t('Save and keep unpublished'), t('Save and publish'))); + $this->assertButtons(array(t('Update draft'), t('Save and publish'))); // Create a node as a normal user. $this->drupalLogout(); @@ -86,7 +86,7 @@ function testNodeFormButtons() { // was created by the normal user. $this->drupalLogout(); $this->drupalLogin($this->admin_user); - $this->drupalPostForm('node/' . $node_2->id() . '/edit', array(), t('Save and unpublish')); + $this->drupalPostForm('node/' . $node_2->id() . '/edit', array(), t('Save draft')); $node_2 = node_load(2, TRUE); $this->assertFalse($node_2->isPublished(), 'Node is unpublished'); @@ -110,7 +110,7 @@ function testNodeFormButtons() { // Verify the buttons on a node add form for an administrator. $this->drupalLogin($this->admin_user); $this->drupalGet('node/add/article'); - $this->assertButtons(array(t('Save as unpublished'), t('Save and publish'))); + $this->assertButtons(array(t('Save draft'), t('Save and publish'))); // Verify the node is unpublished by default for a normal user. $this->drupalLogout(); diff --git a/core/modules/node/src/Tests/NodeRevisionsUiTest.php b/core/modules/node/src/Tests/NodeRevisionsUiTest.php index c9a4a36..2a9fbbc 100644 --- a/core/modules/node/src/Tests/NodeRevisionsUiTest.php +++ b/core/modules/node/src/Tests/NodeRevisionsUiTest.php @@ -51,7 +51,7 @@ function testNodeFormSaveWithoutRevision() { // Uncheck the create new revision checkbox and save the node. $edit = array('revision' => FALSE); - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Update')); // Load the node again and check the revision is the same as before. $node_revision = node_load($node->id(), TRUE); @@ -63,7 +63,7 @@ function testNodeFormSaveWithoutRevision() { // Submit the form without changing the checkbox. $edit = array(); - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Update')); // Load the node again and check the revision is different from before. $node_revision = node_load($node->id(), TRUE); diff --git a/core/modules/node/src/Tests/NodeTranslationUITest.php b/core/modules/node/src/Tests/NodeTranslationUITest.php index b5fd27a..8922093 100644 --- a/core/modules/node/src/Tests/NodeTranslationUITest.php +++ b/core/modules/node/src/Tests/NodeTranslationUITest.php @@ -96,10 +96,10 @@ protected function createEntity($values, $langcode, $bundle_name = NULL) { */ protected function getFormSubmitAction(EntityInterface $entity, $langcode) { if ($entity->getTranslation($langcode)->isPublished()) { - return t('Save and keep published') . $this->getFormSubmitSuffix($entity, $langcode); + return t('Update') . $this->getFormSubmitSuffix($entity, $langcode); } else { - return t('Save and keep unpublished') . $this->getFormSubmitSuffix($entity, $langcode); + return t('Update draft') . $this->getFormSubmitSuffix($entity, $langcode); } } @@ -112,8 +112,8 @@ protected function doTestPublishedStatus() { $languages = $this->container->get('language_manager')->getLanguages(); $actions = array( - t('Save and keep published'), - t('Save and unpublish'), + t('Update'), + t('Save draft'), ); foreach ($actions as $index => $action) { diff --git a/core/modules/node/src/Tests/PageEditTest.php b/core/modules/node/src/Tests/PageEditTest.php index 20f411c..3ce0665 100644 --- a/core/modules/node/src/Tests/PageEditTest.php +++ b/core/modules/node/src/Tests/PageEditTest.php @@ -72,7 +72,7 @@ function testPageEdit() { $edit['title[0][value]'] = $this->randomMachineName(8); $edit[$body_key] = $this->randomMachineName(16); $edit['revision'] = TRUE; - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Update')); // Ensure that the node revision has been created. $revised_node = $this->drupalGetNodeByTitle($edit['title[0][value]'], TRUE); @@ -108,19 +108,19 @@ function testPageAuthoredBy() { $edit = array( 'uid[0][target_id]' => 'invalid-name', ); - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Update')); $this->assertRaw(t('There are no entities matching "%name".', array('%name' => 'invalid-name'))); // Change the authored by field to the anonymous user (uid 0). $edit['uid[0][target_id]'] = 'Anonymous (0)'; - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Update')); $node = node_load($node->id(), TRUE); $this->assertIdentical($node->getOwnerId(), '0', 'Node authored by anonymous user.'); // Change the authored by field to another user's name (that is not // logged in). $edit['uid[0][target_id]'] = $this->web_user->getUsername(); - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Update')); $node = node_load($node->id(), TRUE); $this->assertIdentical($node->getOwnerId(), $this->web_user->id(), 'Node authored by normal user.'); diff --git a/core/modules/options/src/Tests/OptionsFieldUITest.php b/core/modules/options/src/Tests/OptionsFieldUITest.php index e3b4684..dcaca43 100644 --- a/core/modules/options/src/Tests/OptionsFieldUITest.php +++ b/core/modules/options/src/Tests/OptionsFieldUITest.php @@ -311,7 +311,7 @@ function testNodeDisplay() { $edit = array( $this->field_name => '1', ); - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Update')); // Check the node page and see if the values are correct. $file_formatters = array('list_default', 'list_key'); diff --git a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php index e7c98c6..634914d 100644 --- a/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php +++ b/core/modules/search/src/Tests/SearchConfigSettingsFormTest.php @@ -49,7 +49,7 @@ protected function setUp() { // also needs the word "pizza" so we can use it as the search keyword. $body_key = 'body[0][value]'; $edit[$body_key] = \Drupal::l($node->label(), $node->urlInfo()) . ' pizza sandwich'; - $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Update')); $this->container->get('plugin.manager.search')->createInstance('node_search')->updateIndex(); search_update_totals(); diff --git a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php index 0351b89..e2057a4 100644 --- a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php +++ b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php @@ -198,7 +198,7 @@ function testBreadCrumbs() { $edit = array( 'menu[menu_parent]' => $link->getMenuName() . ':' . $link->getPluginId(), ); - $this->drupalPostForm('node/' . $parent->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $parent->id() . '/edit', $edit, t('Update')); $expected = array( "node" => $link->getTitle(), ); @@ -219,7 +219,7 @@ function testBreadCrumbs() { $edit = array( 'field_tags' => implode(',', array_keys($tags)), ); - $this->drupalPostForm('node/' . $parent->id() . '/edit', $edit, t('Save and keep published')); + $this->drupalPostForm('node/' . $parent->id() . '/edit', $edit, t('Update')); // Put both terms into a hierarchy Drupal » Breadcrumbs. Required for both // the menu links and the terms itself, since taxonomy_term_page() resets