Skip to content
Permalink
Browse files

Fixing FriendlyUrl cache not being updated after an external change

  • Loading branch information...
napernik committed Mar 18, 2019
1 parent febc8ac commit dbb189e2afd9437be23cfb5be58ade6f35864dc2
Showing with 8 additions and 1 deletion.
  1. +8 −1 Composite/Plugins/Routing/Pages/DefaultPageUrlProvider.cs
@@ -39,6 +39,13 @@ static DefaultPageUrlProvider()
{
DataEvents<IPage>.OnAfterAdd += (a, b) => UpdateFriendlyUrl((IPage) b.Data);
DataEvents<IPage>.OnAfterUpdate += (a, b) => UpdateFriendlyUrl((IPage) b.Data);
DataEvents<IPage>.OnStoreChanged += (sender, args) =>
{
if (!args.DataEventsFired)
{
lock (_friendlyUrls) _friendlyUrls.Clear();
}
};

DataEvents<IHostnameBinding>.OnAfterAdd += (a, b) => _hostnameBindings = null;
DataEvents<IHostnameBinding>.OnAfterUpdate += (a, b) => _hostnameBindings = null;
@@ -425,7 +432,7 @@ private static void UpdateFriendlyUrl(IPage page)

private PageUrlData ParsePagePath(string pagePath, PublicationScope publicationScope, CultureInfo locale, IHostnameBinding hostnameBinding)
{
// Parshing what's left:
// Parsing what's left:
// [/Path to a page][UrlSuffix]{/PathInfo}
string pathInfo = null;

0 comments on commit dbb189e

Please sign in to comment.
You can’t perform that action at this time.