Getting Child Categories of category when indexing

Hi!

I need to get hold of child categories when indexing with ElasticSearch.
If i call category.GetChildren() I get this error:

error when indexing category System.ArgumentNullException: Value cannot be null. (Parameter ‘Method can only be executed inside a webrequest where RouteRequestLookupInfo is assigned.’)

Is there a safe way of getting hold of the child categories outside a webrequest? If I can get the systemIds of the child categories somehow I could use the category-service to get the info I want from each of them. Is that possible?

Litium version: 8.3

Found an overloaded extension method that worked: category.GetChildren(false, false, channel.SystemId)

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.