Skip to content
Permalink
Browse files

Fixing an exception when content tree wouldn't load

  • Loading branch information...
napernik committed Aug 1, 2019
1 parent b54465b commit 300c99fe8d0ec075dc528f995e01ee85eae100fa
@@ -87,11 +87,16 @@ public static void ReloadPageElementInConsole(IPage page)

public static void ReloadDataElementInConsole(DataEntityToken dataEntityToken)
{
if (dataEntityToken == null) throw new ArgumentNullException(nameof(dataEntityToken));

var parentEntityTokens = AuxiliarySecurityAncestorFacade.GetParents(dataEntityToken);

foreach (var parentEntityToken in parentEntityTokens)
if (parentEntityTokens != null)
{
ConsoleMessageQueueFacade.Enqueue(new RefreshTreeMessageQueueItem { EntityToken = parentEntityToken }, null);
foreach (var parentEntityToken in parentEntityTokens)
{
ConsoleMessageQueueFacade.Enqueue(new RefreshTreeMessageQueueItem { EntityToken = parentEntityToken }, null);
}
}
}

@@ -108,7 +108,8 @@ public IEnumerable<Element> GetRoots(SearchToken searchToken)
{
EntityToken entityToken = new PageElementProviderEntityToken(_context.ProviderName);

if (!DataLocalizationFacade.ActiveLocalizationCultures.Contains(UserSettings.ActiveLocaleCultureInfo))
if (UserValidationFacade.IsLoggedIn()
&& !DataLocalizationFacade.ActiveLocalizationCultures.Contains(UserSettings.ActiveLocaleCultureInfo))
{
yield return new Element(_context.CreateElementHandle(entityToken))
{
@@ -281,7 +282,11 @@ public IEnumerable<Element> GetRoots(SearchToken searchToken)

public IEnumerable<Element> GetChildren(EntityToken entityToken, SearchToken searchToken)
{
if (!DataLocalizationFacade.ActiveLocalizationCultures.Contains(UserSettings.ActiveLocaleCultureInfo)) return Enumerable.Empty<Element>();
if (UserValidationFacade.IsLoggedIn()
&& !DataLocalizationFacade.ActiveLocalizationCultures.Contains(UserSettings.ActiveLocaleCultureInfo))
{
return Enumerable.Empty<Element>();
}

if (entityToken is AssociatedDataElementProviderHelperEntityToken associatedData)
{
@@ -316,7 +321,11 @@ public IEnumerable<Element> GetForeignRoots(SearchToken searchToken)
public IEnumerable<Element> GetForeignChildren(EntityToken entityToken, SearchToken searchToken)
{
if (entityToken is DataEntityToken dataEntityToken && dataEntityToken.Data == null) return Array.Empty<Element>();
if (!DataLocalizationFacade.ActiveLocalizationCultures.Contains(UserSettings.ActiveLocaleCultureInfo)) return Enumerable.Empty<Element>();
if (UserValidationFacade.IsLoggedIn()
&& !DataLocalizationFacade.ActiveLocalizationCultures.Contains(UserSettings.ActiveLocaleCultureInfo))
{
return Enumerable.Empty<Element>();
}

if (entityToken is AssociatedDataElementProviderHelperEntityToken associatedData)
{

0 comments on commit 300c99f

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