1
Vote

Bug in taxonomies TermWidgetPartDriver

description

This occurs after adding a Taxonomy field to productPart (from Nwazet.Commerce), defining several terms, some of them being headers they can't be selected, several term being selectable for each product.

Categories
->Technical (not selectable)
->-> Server
->->DB
->Business (not selectable)
->->CRM
->->Office

Then create a Term widget based on Categories, using the Technical non selectable term, looking for products.

In the display method, an exception is triggered when on
                list.AddRange(
                    results
                        .Slice(0, part.Count)
                        .ToList()
                        .Select( tp => _contentManager.BuildDisplay(tp.ContentItem, "Summary"))
                );
results contains 15 elements
Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator - QueryException thrown from IContentPartDriver by Orchard.Taxonomies.Drivers.TermWidgetPartDriver
NHibernate.QueryException: could not resolve property: ContentType of: Orchard.Core.Common.Models.CommonPartRecord
à NHibernate.Persister.Entity.AbstractPropertyMapping.ToType(String propertyName)
à NHibernate.Persister.Entity.AbstractEntityPersister.GetSubclassPropertyTableNumber(String propertyPath)
à NHibernate.Persister.Entity.BasicEntityPropertyMapping.ToColumns(String alias, String propertyName)
à NHibernate.Persister.Entity.AbstractEntityPersister.ToColumns(String alias, String propertyName)
à NHibernate.Loader.Criteria.CriteriaQueryTranslator.GetColumns(ICriteria subcriteria, String propertyName)
à NHibernate.Loader.Criteria.CriteriaQueryTranslator.GetColumnsUsingProjection(ICriteria subcriteria, String propertyName)
à NHibernate.Criterion.CriterionUtil.GetColumnNamesUsingPropertyName(ICriteriaQuery criteriaQuery, ICriteria criteria, String propertyName, Object value, ICriterion critertion)
à NHibernate.Criterion.CriterionUtil.GetColumnNamesForSimpleExpression(String propertyName, IProjection projection, ICriteriaQuery criteriaQuery, ICriteria criteria, IDictionary2 enabledFilters, ICriterion criterion, Object value)
à NHibernate.Criterion.SimpleExpression.ToSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery, IDictionary
2 enabledFilters)
à NHibernate.Loader.Criteria.CriteriaQueryTranslator.GetWhereCondition(IDictionary2 enabledFilters)
à NHibernate.Loader.Criteria.CriteriaJoinWalker..ctor(IOuterJoinLoadable persister, CriteriaQueryTranslator translator, ISessionFactoryImplementor factory, ICriteria criteria, String rootEntityName, IDictionary
2 enabledFilters)
à NHibernate.Loader.Criteria.CriteriaLoader..ctor(IOuterJoinLoadable persister, ISessionFactoryImplementor factory, CriteriaImpl rootCriteria, String rootEntityName, IDictionary2 enabledFilters)
à NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results)
à NHibernate.Impl.CriteriaImpl.List(IList results)
à NHibernate.Impl.CriteriaImpl.List[T]()
à Orchard.ContentManagement.DefaultContentQuery.Slice(Int32 skip, Int32 count) dans e:\Datwendo\Cloudissime\src\Orchard\ContentManagement\DefaultContentQuery.cs:ligne 156
à Orchard.ContentManagement.DefaultContentQuery.ContentQuery
1.Orchard.ContentManagement.IContentQuery<T>.Slice(Int32 skip, Int32 count) dans e:\Datwendo\Cloudissime\src\Orchard\ContentManagement\DefaultContentQuery.cs:ligne 210
à Orchard.Taxonomies.Drivers.TermWidgetPartDriver.<>c__DisplayClass6.<Display>b__4()
à Orchard.ContentManagement.Drivers.ContentPartDriver1.<>c__DisplayClassf.<ContentShape>b__e(BuildShapeContext ctx) dans e:\Datwendo\Cloudissime\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:ligne 130
à Orchard.ContentManagement.Drivers.ContentPartDriver
1.<>c__DisplayClass15.<ContentShapeImplementation>b__14(BuildShapeContext ctx) dans e:\Datwendo\Cloudissime\src\Orchard\ContentManagement\Drivers\ContentPartDriver.cs:ligne 139
à Orchard.ContentManagement.Drivers.ContentShapeResult.ApplyImplementation(BuildShapeContext context, String displayType) dans e:\Datwendo\Cloudissime\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:ligne 39
à Orchard.ContentManagement.Drivers.ContentShapeResult.Apply(BuildDisplayContext context) dans e:\Datwendo\Cloudissime\src\Orchard\ContentManagement\Drivers\ContentShapeResult.cs:ligne 21
à Orchard.ContentManagement.Drivers.Coordinators.ContentPartDriverCoordinator.<>c__DisplayClassa.<BuildDisplay>b__9(IContentPartDriver driver) dans e:\Datwendo\Cloudissime\src\Orchard\ContentManagement\Drivers\Coordinators\ContentPartDriverCoordinator.cs:ligne 49
à Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable1 events, Action1 dispatch, ILogger logger) dans e:\Datwendo\Cloudissime\src\Orchard\InvokeExtensions.cs:ligne 17

comments

CSADNT wrote Apr 30, 2013 at 5:48 PM

Unable to find the reason why, but I have found a small bug in the same driver Display methode
                    switch(part.OrderBy) {
                        case "CreatedUtc": orderBy = d => d.CreatedUtc; break;
                        case "PublishedUtc": orderBy = d => d.PublishedUtc; break;
                        case "ModifiedUtc": orderBy = d => d.ModifiedUtc; break;
                    }

CSADNT wrote Apr 30, 2013 at 5:49 PM

The bug is only here when we select a dedicated Contentype, the driver is sorking in the other case

CSADNT wrote May 1, 2013 at 8:03 AM

working....(mais be codeplex team could allow editing its post here as on discussions)

agriffard wrote Jul 12, 2013 at 11:21 AM

This widget has been removed.
Use projections instead ?

CSADNT wrote Jul 12, 2013 at 12:35 PM

I have seen this, seems that 1.7 will draw a strong line on some previous bugs: migrate or solve it yourself.
Hopefully I have stopped using it.
And what about the new but already died Taxonomy Menu which based on Terms, was buggy
https://orchard.codeplex.com/workitem/19680