Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.

 

Self referencing loop detected for property 'ManifestModule'

Vote:
 

Hi,

We are getting the same error stacktrace described in this post:

http://world.episerver.com/forum/developer-forum/EPiServer-Search/Thread-Container/2014/8/Indexing-issues/

But we're getting it when attempting to do a nested search in Find. We have a nested convention applied:

SearchClient.Instance.Conventions.NestedConventions.ForType().Add(v => v.ListingDates);

Where listing dates is a collection of a custom object type.

And in the search query:

            DateTime now = DateTime.Now;

            var exp = new NestedFilterExpression(
                item => item.ListingDates, 
                item => item.ListedFrom.Exists() & item.ListedFrom.LessThan(now) & item.ListedTo.Exists() & item.ListedTo.LessThan(now), 
                SearchClient.Instance.Conventions);

            return new FilterExpression(x =>
                x.MatchType(typeof(Variant.Models.Variant)) &
                ((Variant.Models.Variant)x).ListingDates.MatchItem(item => exp));

It blows up with the error text 'Self referencing loop detected for property 'ManifestModule' - the JSON.NET serializer seems to be choking on a recursive reference within the Assembly, though why it's trying to serialize the assembly I have no idea!

Any pointers appreciated as to whether this is a bug or a problem with the way we're using Find.

#152621
Aug 26, 2016 12:22
Vote:
 

Can you add code for the classes Variant and ListingDates. Do they have navigation properties going both ways?

#152626
Aug 26, 2016 12:36
Vote:
 

Hi Daniel,

No, they don't - the ProductListingDateRange class has just 3 properties:

    public class ProductListingDateRange
    {

        public virtual string MarketId { get; set; }

        public virtual DateTime? ListedFrom { get; set; }

        public virtual DateTime? ListedTo { get; set; }


    }

And the variant class exposes a collection of these as an IEnumerable.

Thanks

#152627
Edited, Aug 26, 2016 12:44
Vote:
 

I had a similar issue and I solved it by using the NestedFilter property on my NestedFilterExpression

So try changing your return statement to this.

return new FilterExpression<IContent>(x =>
    x.MatchType(typeof(Variant.Models.Variant)) &
    ((Variant.Models.Variant)x).ListingDates.MatchItem(item => exp.NestedFilter));
#154944
Sep 02, 2016 20:55
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.