Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ContentQuery LINQ StartsWith issue #348
var crmcontactsall = this.Model.Items.Where(c => c.Type("RorWebCRMContact") && c.Path.StartsWith(company.Path)).ToList();
This worked in 7.0.2, but after upgrading to 7.1.1 it gives 0 results without an error. If we replace the 'startswith' term with 'InTree' (which is the recommended way anyway) it works correctly.
var crmcontactsall = this.Model.Items.Where(c => c.Type("RorWebCRMContact") && c.InTree(company.Path)).ToList();
I cannot reproduce this bug so I would like to see/debug the actual solution. The ContentCollectionView.Model is a ContentCollectionViewModel (what a surprise). This object is generally an IQueryable that can wrap IEnumerable or ISnQueryable. This duality maybe can cause an error but I think this is not the case now.
I've managed to reproduce the bug with the following steps:
and duplicate the foreach to use these lists
With the same result (test3 nothing, test4 working).
I could try to reproduce this on a demo site if there is any.