Skip to content

Commit

Permalink
Fixed HideFromSearch logic. content.Property["HideFromSearch"] does n…
Browse files Browse the repository at this point in the history
…ot return boolean. Used reflection to fetch value.
  • Loading branch information
NCG\oyvind.tanum committed Jun 22, 2022
1 parent 08e0b96 commit 06175c2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Epinova.ElasticSearch.Core.EPiServer/Indexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,8 @@ public bool ShouldHideFromSearch(IContent content)
}

// Common property in Epinova template
var hideFromSearch = GetEpiserverBoolProperty(content.Property["HideFromSearch"]);

return hideFromSearch;
object value = content.GetType().GetProperty("HideFromSearch")?.GetValue(content);
return value != null && Convert.ToBoolean(value);
}

private static bool IsPageWithInvalidLinkType(IContent content)
Expand Down

0 comments on commit 06175c2

Please sign in to comment.