diff --git a/eZ/Publish/Core/Persistence/Cache/Tests/UrlAliasHandlerTest.php b/eZ/Publish/Core/Persistence/Cache/Tests/UrlAliasHandlerTest.php index 4d0648c7989..20946998f15 100644 --- a/eZ/Publish/Core/Persistence/Cache/Tests/UrlAliasHandlerTest.php +++ b/eZ/Publish/Core/Persistence/Cache/Tests/UrlAliasHandlerTest.php @@ -29,7 +29,7 @@ public function providerForUnCachedMethods(): array // string $method, array $arguments, array? $tags, array? $key, mixed? $returnValue return [ ['publishUrlAliasForLocation', [44, 2, 'name', 'eng-GB', true, false], ['urlAlias-location-44', 'urlAlias-location-path-44', 'urlAlias-notFound']], - ['createCustomUrlAlias', [44, '1/2/44', true, null, false], ['urlAlias-location-44', 'urlAlias-location-path-44', 'urlAlias-notFound']], + ['createCustomUrlAlias', [44, '1/2/44', true, null, false], ['urlAlias-location-44', 'urlAlias-location-path-44', 'urlAlias-notFound', 'urlAlias-5'], null, new UrlAlias(['id' => 5])], ['createGlobalUrlAlias', ['something', '1/2/44', true, null, false], ['urlAlias-notFound']], ['createGlobalUrlAlias', ['something', '1/2/44', true, 'eng-GB', false], ['urlAlias-notFound']], ['listGlobalURLAliases', ['eng-GB', 10, 50]], diff --git a/eZ/Publish/Core/Persistence/Cache/UrlAliasHandler.php b/eZ/Publish/Core/Persistence/Cache/UrlAliasHandler.php index 1595850fd99..bad845776f4 100644 --- a/eZ/Publish/Core/Persistence/Cache/UrlAliasHandler.php +++ b/eZ/Publish/Core/Persistence/Cache/UrlAliasHandler.php @@ -79,7 +79,12 @@ public function createCustomUrlAlias($locationId, $path, $forwarding = false, $l $alwaysAvailable ); - $this->cache->invalidateTags(['urlAlias-location-' . $locationId, 'urlAlias-location-path-' . $locationId, 'urlAlias-notFound']); + $this->cache->invalidateTags([ + 'urlAlias-location-' . $locationId, + 'urlAlias-location-path-' . $locationId, + 'urlAlias-notFound', + 'urlAlias-' . $urlAlias->id, + ]); return $urlAlias; }