Skip to content
Snippets Groups Projects
Verified Commit 8749104b authored by Jess's avatar Jess
Browse files

Issue #3226334 by albertosilva, pauger, xjm, smustgrave, K3vin_nl, krisahil:...

Issue #3226334 by albertosilva, pauger, xjm, smustgrave, K3vin_nl, krisahil: PathAliasManager could not find the alias by the internal path

(cherry picked from commit 9cc7cfaa)
parent 7447663e
No related branches found
No related tags found
Loading
......@@ -221,7 +221,7 @@ public function getAliasByPath($path, $langcode = NULL) {
if (!empty($this->preloadedPathLookups[$langcode])) {
$this->lookupMap[$langcode] = $this->pathAliasRepository->preloadPathAlias($this->preloadedPathLookups[$langcode], $langcode);
// Keep a record of paths with no alias to avoid querying twice.
$this->noAlias[$langcode] = array_flip(array_diff_key($this->preloadedPathLookups[$langcode], array_keys($this->lookupMap[$langcode])));
$this->noAlias[$langcode] = array_flip(array_diff($this->preloadedPathLookups[$langcode], array_keys($this->lookupMap[$langcode])));
}
}
......
......@@ -259,7 +259,14 @@ public function testGetAliasByPathCachedMatch() {
$language = $this->setUpCurrentLanguage();
$cached_paths = [$language->getId() => [$path]];
// Use a set of cached paths where the tested path is in any position, not
// only in the first one.
$cached_paths = [
$language->getId() => [
'/another/path',
$path,
],
];
$this->cache->expects($this->once())
->method('get')
->with($this->cacheKey)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment