diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index 295b234..147b5c9 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -115,11 +115,10 @@ public function form(array $form, FormStateInterface $form_state) { '#access' => !$node->isNew(), '#wrapper_attributes' => ['class' => ['entity-meta__title']], ]; - $changed = !$node->isNew() ? format_date($node->getChangedTime(), 'short') : $this->t('Not saved yet'); $form['meta']['changed'] = [ '#type' => 'item', '#title' => $this->t('Last saved'), - '#markup' => $changed, + '#markup' => !$node->isNew() ? format_date($node->getChangedTime(), 'short') : $this->t('Not saved yet'), '#wrapper_attributes' => ['class' => ['entity-meta__last-saved']], ]; diff --git a/core/modules/node/tests/src/Functional/NodeCreationTest.php b/core/modules/node/tests/src/Functional/NodeCreationTest.php index 4d24901..9ceb884 100644 --- a/core/modules/node/tests/src/Functional/NodeCreationTest.php +++ b/core/modules/node/tests/src/Functional/NodeCreationTest.php @@ -41,6 +41,7 @@ public function testNodeCreation() { $this->drupalGet('node/add'); $this->assertResponse(200); $this->assertUrl('node/add/page'); + $this->assertText('Not saved yet'); // Create a node. $edit = []; $edit['title[0][value]'] = $this->randomMachineName(8);