diff --git a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
index e0666d9..75d8279 100644
--- a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
+++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
@@ -205,13 +205,13 @@ public function massageFormValues(array $values, array $form, FormStateInterface
           return $values;
         }
 
-        // @todo Don't use the toArray method here. Removed once it is
-        //   deprecated.
-        $value += $url->toArray();
+        $value['options'] = $url->getOptions();
 
         // Reset the URL value to contain only the path.
         if (!$url->isExternal() && $this->supportsInternalLinks()) {
           $value['url'] = substr($url->toString(), strlen(\Drupal::request()->getBasePath() . '/'));
+          $value['route_name'] =  $url->getRouteName();
+          $value['route_parameters'] = $url->getRouteParameters();
         }
       }
     }
diff --git a/core/modules/link/src/Tests/LinkFieldTest.php b/core/modules/link/src/Tests/LinkFieldTest.php
index 97058f0..717f544 100644
--- a/core/modules/link/src/Tests/LinkFieldTest.php
+++ b/core/modules/link/src/Tests/LinkFieldTest.php
@@ -124,6 +124,8 @@ function testURLValidation() {
     );
 
     // Test external and internal URLs for 'link_type' = LinkItemInterface::LINK_GENERIC.
+    $this->field->settings['link_type'] = LinkItemInterface::LINK_GENERIC;
+    $this->field->save();
     $this->assertValidEntries($field_name, $valid_external_entries + $valid_internal_entries);
     $this->assertInvalidEntries($field_name, $invalid_external_entries + $invalid_internal_entries);
 
@@ -158,6 +160,10 @@ protected function assertValidEntries($field_name, array $valid_entries) {
       $id = $match[1];
       $this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
       $this->assertRaw($value);
+      // Verify that the link appears as expected.
+      $this->drupalGet('entity_test/' . $id);
+      $this->assertText($field_name);
+      $this->assertLinkByHref($value);
     }
   }
 
