Projections Module - How to use Grouping

Topics: Administration, General, Troubleshooting
Mar 12, 2012 at 4:27 PM

Having a play with the projections module and am trying to get the grouping working.

I setup a query with filters and create a html list layout, using the content display mode.  Create a Projection and the page displays all the elements as expected :) To add a grouping I have added a new property to the layout and then selecting it in the grouping property dropdown. Now I don't get any records displayed on the page?  I can't seem to get any records to show when I use the grouping.  I'm just using the creation date to play with, have also tried title but still no joy.

Any ideas?

Thanks 

Coordinator
Mar 12, 2012 at 4:46 PM

Error in the logs ?

Do you have a repro ?

Mar 12, 2012 at 6:35 PM

Actually, I'm seeing the same thing playing around with queries for the Movie content items in my Pluralsight demo. I added a Binding for a property on my MoviePart (the YearReleased) property, then added it as a property on the layout. I choose to group by that property but then the projection doesn't show any items at all.

This is the exception from the logs:

2012-03-12 14:17:18,280 [21] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - ArgumentNullException thrown from IContentPartDriver by Orchard.Projections.Drivers.ProjectionPartDriverSystem.ArgumentNullException: Value cannot be null.Parameter name: view   at System.Web.Mvc.ViewContext..ctor(ControllerContext controllerContext, IView view, ViewDataDictionary viewData, TempDataDictionary tempData, TextWriter writer)   at System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection)   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model)   at Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.Render(ShapeDescriptor shapeDescriptor, DisplayContext displayContext, HarvestShapeInfo harvestShapeInfo, HarvestShapeHit harvestShapeHit) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:line 134   at Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.<>c__DisplayClass26.<>c__DisplayClass28.<Discover>b__15(DisplayContext displayContext) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:line 118   at Orchard.DisplayManagement.Descriptors.ShapeAlterationBuilder.<>c__DisplayClass3.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:line 55   at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 179   at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 98   at Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 71   at Orchard.DisplayManagement.Implementation.DisplayHelper.Invoke(String name, INamedEnumerable`1 parameters) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 38   at Orchard.DisplayManagement.Implementation.DisplayHelperFactory.DisplayHelperBehavior.InvokeMember(Func`1 proceed, Object target, String name, INamedEnumerable`1 args) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\DisplayManagement\Implementation\DisplayHelperFactory.cs:line 27   at ClaySharp.ClayBehaviorCollection.<>c__DisplayClass14.<>c__DisplayClass16.<InvokeMember>b__13() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 29   at ClaySharp.ClayBehaviorCollection.Execute(Func`1 proceed, Func`3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 13   at ClaySharp.ClayBehaviorCollection.InvokeMember(Func`1 proceed, Object self, String name, INamedEnumerable`1 args) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 29   at Orchard.Projections.Drivers.ProjectionPartDriver.<>c__DisplayClass36.<>c__DisplayClass44.<Display>b__33(LayoutComponentResult x)   at System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)   at System.Linq.GroupedEnumerable`3.GetEnumerator()   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()   at Orchard.Projections.Drivers.ProjectionPartDriver.<>c__DisplayClass36.<Display>b__25(Object shape)   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClass10.<ContentShape>b__f(BuildShapeContext ctx) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 112   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClass13.<ContentShapeImplementation>b__12(BuildShapeContext ctx) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 116   at Orchard.ContentManagement.Drivers.ContentShapeResult.ApplyImplementation(BuildShapeContext context, String displayType) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 37   at Orchard.ContentManagement.Drivers.ContentShapeResult.Apply(BuildDisplayContext context) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 21   at Orchard.ContentManagement.Drivers.CombinedResult.Apply(BuildDisplayContext context) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\ContentManagement\Drivers\CombinedResult.cs:line 28   at Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>c__DisplayClassa.<BuildDisplay>b__9(IContentPartDriver driver) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 49   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in D:\Dev\PluralsightMoviesBootstrap\src\Orchard\InvokeExtensions.cs:line 19

Mar 12, 2012 at 9:20 PM

Repo...

1. Create a few pages
2. New query
3. Content Types filter by page
4. Html list layout, content display mode, unordered list
5. Add property to layout, Created date, format -> Year month pattern
6. New projection using above query and layout
7. Browse to page -> no content in list

Here is the error I get, its the same as Kevink above... cheers

012-03-12 21:14:00,122 [5] Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - ArgumentNullException thrown from IContentPartDriver by Orchard.Projections.Drivers.ProjectionPartDriverSystem.ArgumentNullException: Value cannot be null.Parameter name: view   at System.Web.Mvc.ViewContext..ctor(ControllerContext controllerContext, IView view, ViewDataDictionary viewData, TempDataDictionary tempData, TextWriter writer)   at System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection)   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData)   at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model)   at Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.Render(ShapeDescriptor shapeDescriptor, DisplayContext displayContext, HarvestShapeInfo harvestShapeInfo, HarvestShapeHit harvestShapeHit) in C:\Development\cpd\orchard_cms\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:line 134   at Orchard.DisplayManagement.Descriptors.ShapeTemplateStrategy.ShapeTemplateBindingStrategy.<>c__DisplayClass26.<>c__DisplayClass28.<Discover>b__15(DisplayContext displayContext) in C:\Development\cpd\orchard_cms\src\Orchard\DisplayManagement\Descriptors\ShapeTemplateStrategy\ShapeTemplateBindingStrategy.cs:line 118   at Orchard.DisplayManagement.Descriptors.ShapeAlterationBuilder.<>c__DisplayClass3.<>c__DisplayClass5.<BoundAs>b__2(DisplayContext displayContext) in C:\Development\cpd\orchard_cms\src\Orchard\DisplayManagement\Descriptors\ShapeAlterationBuilder.cs:line 55   at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Process(ShapeBinding shapeBinding, IShape shape, DisplayContext context) in C:\Development\cpd\orchard_cms\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 179   at Orchard.DisplayManagement.Implementation.DefaultDisplayManager.Execute(DisplayContext context) in C:\Development\cpd\orchard_cms\src\Orchard\DisplayManagement\Implementation\DefaultDisplayManager.cs:line 98   at Orchard.DisplayManagement.Implementation.DisplayHelper.ShapeExecute(Object shape) in C:\Development\cpd\orchard_cms\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 71   at Orchard.DisplayManagement.Implementation.DisplayHelper.Invoke(String name, INamedEnumerable`1 parameters) in C:\Development\cpd\orchard_cms\src\Orchard\DisplayManagement\Implementation\DisplayHelper.cs:line 38   at Orchard.DisplayManagement.Implementation.DisplayHelperFactory.DisplayHelperBehavior.InvokeMember(Func`1 proceed, Object target, String name, INamedEnumerable`1 args) in C:\Development\cpd\orchard_cms\src\Orchard\DisplayManagement\Implementation\DisplayHelperFactory.cs:line 27   at ClaySharp.ClayBehaviorCollection.<>c__DisplayClass14.<>c__DisplayClass16.<InvokeMember>b__13() in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 29   at ClaySharp.ClayBehaviorCollection.Execute(Func`1 proceed, Func`3 linker) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 13   at ClaySharp.ClayBehaviorCollection.InvokeMember(Func`1 proceed, Object self, String name, INamedEnumerable`1 args) in C:\Users\sebros\My Projects\Clay\src\ClaySharp\ClayBehaviorCollection.cs:line 29   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)   at Orchard.Projections.Drivers.ProjectionPartDriver.<>c__DisplayClass36.<>c__DisplayClass44.<Display>b__33(LayoutComponentResult x) in c:\Development\cpd\orchard_cms\src\Orchard.Web\Modules\Orchard.Projections\Drivers\ProjectionPartDriver.cs:line 184   at System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)   at System.Linq.GroupedEnumerable`3.GetEnumerator()   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()   at Orchard.Projections.Drivers.ProjectionPartDriver.<>c__DisplayClass36.<Display>b__25(Object shape) in c:\Development\cpd\orchard_cms\src\Orchard.Web\Modules\Orchard.Projections\Drivers\ProjectionPartDriver.cs:line 189   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClass10.<ContentShape>b__f(BuildShapeContext ctx) in C:\Development\cpd\orchard_cms\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 112   at Orchard.ContentManagement.Drivers.ContentPartDriver`1.<>c__DisplayClass13.<ContentShapeImplementation>b__12(BuildShapeContext ctx) in C:\Development\cpd\orchard_cms\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:line 116   at Orchard.ContentManagement.Drivers.ContentShapeResult.ApplyImplementation(BuildShapeContext context, String displayType) in C:\Development\cpd\orchard_cms\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 37   at Orchard.ContentManagement.Drivers.ContentShapeResult.Apply(BuildDisplayContext context) in C:\Development\cpd\orchard_cms\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:line 21   at Orchard.ContentManagement.Drivers.CombinedResult.Apply(BuildDisplayContext context) in C:\Development\cpd\orchard_cms\src\Orchard\ContentManagement\Drivers\CombinedResult.cs:line 28   at Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>c__DisplayClassa.<BuildDisplay>b__9(IContentPartDriver driver) in C:\Development\cpd\orchard_cms\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:line 49   at Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in C:\Development\cpd\orchard_cms\src\Orchard\InvokeExtensions.cs:line 19 

Coordinator
Mar 13, 2012 at 12:25 AM

Please file a bug.