diff --git a/core/modules/path/path.module b/core/modules/path/path.module
index 24309b7..4a1ce58 100644
--- a/core/modules/path/path.module
+++ b/core/modules/path/path.module
@@ -46,7 +46,7 @@ function path_form_node_form_alter(&$form, FormStateInterface $form_state) {
   $form['path_settings'] = array(
     '#type' => 'details',
     '#title' => t('URL path settings'),
-    '#open' => !empty($form['path']['widget'][0]['alias']['#value']),
+    '#open' => !empty($form['path']['widget'][0]['alias']['#default_value']),
     '#group' => 'advanced',
     '#access' => !empty($form['path']['#access']) && $node->hasField('path') && $node->get('path')->access('edit'),
     '#attributes' => array(
diff --git a/core/modules/path/src/Tests/PathNodeFormTest.php b/core/modules/path/src/Tests/PathNodeFormTest.php
index 5ba3774..b454cde 100644
--- a/core/modules/path/src/Tests/PathNodeFormTest.php
+++ b/core/modules/path/src/Tests/PathNodeFormTest.php
@@ -25,7 +25,14 @@ protected function setUp() {
     parent::setUp();
 
     // Create test user and login.
-    $web_user = $this->drupalCreateUser(array('create page content', 'create url aliases'));
+    $web_user = $this->drupalCreateUser(array(
+        'administer nodes',
+        'bypass node access',
+        'create url aliases',
+        'administer themes',
+        'view the administration theme'
+      )
+    );
     $this->drupalLogin($web_user);
   }
 
@@ -33,12 +40,19 @@ protected function setUp() {
    * Tests the node form ui.
    */
   public function testNodeForm() {
+    \Drupal::service('theme_handler')->install(array('seven'));
+    $this->drupalPostForm('admin/appearance', array('admin_theme' => 'seven', 'use_admin_theme' => '1'), t('Save configuration'));
+
     $this->drupalGet('node/add/page');
 
     // Make sure we have a Path fieldset and Path fields.
     $this->assertRaw(' id="edit-path-settings"', 'Path settings details exists');
     $this->assertFieldByName('path[0][alias]', NULL, 'Path alias field exists');
 
+    $this->drupalPostForm(NULL, array('title[0][value]' => 'Node with alias', 'path[0][alias]' => '/alias'), 'Save and publish');
+    $this->drupalGet('node/1/edit');
+    $this->assertRaw('id="edit-path-settings" open="open"');
+
     // Disable the Path field for this content type.
     entity_get_form_display('node', 'page', 'default')
       ->removeComponent('path')
