Accelerator displaying filters not set in back office

Hi,

I have a strange problem with a site displaying incorrect facetfilters. Basically, if I go to back office > Accelerator > Product filtering and set the fields “Size”, “Color” and “Brand”, then go to Websites > Websites and set “Filters ordering” to “Size”, a category page displays “Size” and “Color”. Actually filtering the products by “Size” works, but filtering by “Color” does not, presumably because “Color” isn’t set in filters ordering.

I have a sample accelerator 7.1 where this works just fine, but I have not been able to figure out which changes could fix the problem.

Any pointers?

Litium version: 7.1
Accelerator version: 7.0

Never mind, I figured it out.

FilterViewModelBuilder has the following linq statement:

return result
       .Select(x => new Tuple<string, int>(x, filters.IndexOf(x)))
       .Where(x => x.Item2 != -1)
       .OrderBy(x => x.Item2)
       .Select(x => x.Item1)
       .ToList();

In my version, the .Where was missing, for some reason, which caused the unwanted filters to appear.