diff --git a/core/lib/Drupal/Core/Path/AliasManager.php b/core/lib/Drupal/Core/Path/AliasManager.php index 8a4b7ed..da3555b 100644 --- a/core/lib/Drupal/Core/Path/AliasManager.php +++ b/core/lib/Drupal/Core/Path/AliasManager.php @@ -222,7 +222,7 @@ protected function lookupPathSource($path, $langcode) { // Look for the value $path within the cached $map $source = isset($this->lookupMap[$langcode]) ? array_search($path, $this->lookupMap[$langcode]) : FALSE; if (!$source) { - if ($source = $this->path->lookupPathAlias($path, $langcode)) { + if ($source = $this->path->lookupPathSource($path, $langcode)) { $this->lookupMap[$langcode][$source] = $path; } else { diff --git a/core/lib/Drupal/Core/Path/Path.php b/core/lib/Drupal/Core/Path/Path.php index d63cf08..74aeae0 100644 --- a/core/lib/Drupal/Core/Path/Path.php +++ b/core/lib/Drupal/Core/Path/Path.php @@ -159,13 +159,13 @@ public function preloadPathAlias($preloaded, $langcode) { ':langcode' => $langcode, ':langcode_undetermined' => Language::LANGCODE_NOT_SPECIFIED, ); - // Always get the language-specific alias before the language-neutral - // one. For example 'de' is less than 'und' so the order needs to be - // ASC, while 'xx-lolspeak' is more than 'und' so the order needs to - // be DESC. We also order by pid ASC so that fetchAllKeyed() returns - // the most recently created alias for each source. Subsequent queries - // using fetchField() must use pid DESC to have the same effect. - // For performance reasons, the query builder is not used here. + // Always get the language-specific alias before the language-neutral one. + // For example 'de' is less than 'und' so the order needs to be ASC, while + // 'xx-lolspeak' is more than 'und' so the order needs to be DESC. We also + // order by pid ASC so that fetchAllKeyed() returns the most recently + // created alias for each source. Subsequent queries using fetchField() must + // use pid DESC to have the same effect. For performance reasons, the query + // builder is not used here. if ($langcode == Language::LANGCODE_NOT_SPECIFIED) { // Prevent PDO from complaining about a token the query doesn't use. unset($args[':langcode']); @@ -182,16 +182,15 @@ public function preloadPathAlias($preloaded, $langcode) { } /** - * Given a path source, return its path alias if one exists. Otherwise, - * return FALSE. + * Given a path source, return its path alias or FALSE is non-existing. * - * @param $path + * @param string $path * The path to investigate for corresponding path aliases. - * @param $langcode + * @param string $langcode * Language code to search the path with. If there's no path defined for * that language it will search paths without language. * - * @return + * @return string|bool * A path alias, or FALSE if no path was found. */ public function lookupPathAlias($path, $langcode) { @@ -216,16 +215,15 @@ public function lookupPathAlias($path, $langcode) { } /** - * Given an alias, return its Drupal system URL if one exists. Otherwise, - * return FALSE. + * Given an alias, return its Drupal system URL or FALSE if non-existing. * - * @param $path + * @param string $path * The path to investigate for corresponding system URLs. - * @param $langcode + * @param string $langcode * Language code to search the path with. If there's no path defined for * that language it will search paths without language. * - * @return + * @return string|bool * A Drupal system path, or FALSE if no path was found. */ public function lookupPathSource($path, $langcode) {