diff --git a/core/modules/link/link.install b/core/modules/link/link.install index 0153aed101..a5917a1b84 100644 --- a/core/modules/link/link.install +++ b/core/modules/link/link.install @@ -1,6 +1,11 @@ count($sandbox['entities'][$sandbox['current_entity']])) { $sandbox['current_entity_index'] = 0; @@ -66,4 +70,4 @@ function link_update_8001(&$sandbox = NULL) { if ($sandbox['#finished'] >= 1) { return t('Links validated. Please see output for results.'); } -} \ No newline at end of file +} diff --git a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php index c300077957..2de73c4215 100644 --- a/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php +++ b/core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php @@ -182,7 +182,7 @@ public static function urlWillProcessAsUserEntered($user_link) { } // Prepend back the base path after resolving the alias. $non_aliased_path = $base_path . \Drupal::service('path.alias_manager') - ->getPathByAlias($non_aliased_path_search); + ->getPathByAlias($non_aliased_path_search); // Some times, for example in our tests, the front page can be set to // something else than "/". In that case, our validator will tell the // user that the link is not valid because the link resolves to diff --git a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php index 5ec85c909e..c7725bf245 100644 --- a/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php +++ b/core/modules/menu_link_content/tests/src/Functional/MenuLinkContentTranslationUITest.php @@ -134,15 +134,15 @@ protected function doTestTranslationEdit() { /** * Tests that linking to another language prefixed path triggers an error. */ - function testMenuLinkLanguagePrefixValidation() { + public function testMenuLinkLanguagePrefixValidation() { $this->drupalLogin($this->administrator); // Add a menu link in the tools menu. - $edit = array( + $edit = [ 'title[0][value]' => 'Invalid link with language prefix', // Link to an Italian admin page. Should not be allowed. 'link[0][uri]' => '/it/admin/structure/menu', - ); + ]; $this->drupalPostForm('admin/structure/menu/manage/tools/add', $edit, t('Save')); $this->assertRaw(t('The link you entered is not valid. One reason can be that you entered a link with a language prefix. Did you for example mean to link to @url?', [ '@url' => '/admin/structure/menu',