|
|
Hi,
This has something to do with the query i'm using, I've tried to replicate it on a clean install and I couldn't.
A bit of background, i'm using ZenGallery content type with a mediapicker field for a summary image (the image used in projections etc), the query's XML looks like:
<Query Id="/Identifier=ad9e3277b4ad47ec8ad2989e094dde76" Status="Published">
<TitlePart Title="Outro portfolio" />
<IdentityPart Identifier="ad9e3277b4ad47ec8ad2989e094dde76" />
<QueryPart>
<FilterGroups>
<FilterGroup>
<Filter Category="ZenGalleryContentFields" Description="" Position="0" State="<Form><Description></Description><Operator>NotEquals</Operator><Value></Value><__RequestVerificationToken>w-SbymcdS4RAX-6mvplKhPsLvIhBl5wAkQAvaUHxCN-dwDGZ2ewL4QyR7tLKwMex6p3odL2Jwt84_6s8nqKlgwvQNDHxtw0mLeYCOSM38MZ8sVGWb9BmR7fHsLs7dr2RTkpPc5q3CiA_vRU2CKN2hbzB6Idd06-jfFPDBgCIQSs1</__RequestVerificationToken></Form>" Type="ZenGallery.SummaryImage." />
</FilterGroup>
</FilterGroups>
<SortCriteria>
<SortCriterion Category="General" Description="" Position="0" State="" Type="Random" />
</SortCriteria>
<Layouts>
<Layout Category="Html" Description="" State="<Form><QueryId>34</QueryId><Category>Html</Category><Type>List</Type><Description></Description><Display>0</Display><DisplayType>Summary</DisplayType><Order>unordered</Order><ListId></ListId><ListClass>gallery</ListClass><ItemClass></ItemClass><__RequestVerificationToken>Tdbiu4b4TMl3OqSSK2YmnF8saW09latKro9M85OgUGdrOH92a7GAEYeOIbLMtFojYG3Cp9DqE0D9NZehXINidBJNqtxxsKinLWU7ub971_mJADtSoqbhsMY9J_kJQnLWxVeYYhiwIXDQVGYlw7DdJQiJWCZVAg0F3qIi02-KBB01</__RequestVerificationToken></Form>" Display="0" DisplayType="Summary" Type="List">
<Properties />
<Group />
</Layout>
</Layouts>
</QueryPart>
</Query>
For everyone's sanity :) in the UI it looks like http://imageshack.us/photo/my-images/837/query.png/
Whenever I try to remove the sort critireon, to say, add another one, I get the following exception and the query is unusable, I can't edit, export or use it:
No row with the given identifier exists[Orchard.Projections.Models.SortCriterionRecord#2]
NHibernate.ObjectNotFoundException: No row with the given identifier exists[Orchard.Projections.Models.SortCriterionRecord#2] em NHibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound(String entityName, Object id) em NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent
event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) em Orchard.Data.Providers.AbstractDataServicesProvider.OrchardLoadEventListener.OnLoad(LoadEvent event, LoadType loadType) em NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType
loadType) em NHibernate.Impl.SessionImpl.InternalLoad(String entityName, Object id, Boolean eager, Boolean isNullable) em NHibernate.Type.EntityType.ResolveIdentifier(Object id, ISessionImplementor session) em NHibernate.Collection.PersistentBag.InitializeFromCache(ICollectionPersister
persister, Object disassembled, Object owner) em NHibernate.Cache.Entry.CollectionCacheEntry.Assemble(IPersistentCollection collection, ICollectionPersister persister, Object owner) em NHibernate.Event.Default.DefaultInitializeCollectionEventListener.InitializeCollectionFromCache(Object
id, ICollectionPersister persister, IPersistentCollection collection, ISessionImplementor source) em NHibernate.Event.Default.DefaultInitializeCollectionEventListener.OnInitializeCollection(InitializeCollectionEvent event) em NHibernate.Impl.SessionImpl.InitializeCollection(IPersistentCollection
collection, Boolean writing) em NHibernate.Collection.AbstractPersistentCollection.ReadSize() em NHibernate.Collection.PersistentBag.get_Count() em System.Linq.Buffer`1..ctor(IEnumerable`1 source) em System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
em Orchard.Projections.Controllers.AdminController.Edit(Int32 id) em lambda_method(Closure , ControllerBase , Object[] ) em System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) em System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext
controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) em System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass13.<InvokeActionMethodWithFilters>b__10() em System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter
filter, ActionExecutingContext preContext, Func`1 continuation) em System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) em System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter
filter, ActionExecutingContext preContext, Func`1 continuation)
Any ideas?
Thanks
|
|
Nov 6, 2012 at 12:28 PM
Edited Nov 6, 2012 at 12:34 PM
|
Correct me if I'm wrong but your Query seems to be returning an Image or collection of images (screenshot of what is returned will help), if so there is no Identifier for the Sort criteria to be based on, I had thought.
For example, you Query to get all Page ContentItems in your site, and within the Page ContentType there's an Identifier to enable a sort criterion to be executed e.g. Date published/created/saved etc...
Hope that helps.
|
|
|
|
It is returning the content types ZenGallery as expected, where the ZenGallery.SummaryImage is not empty, unless I'm misusing the Filters?
To be honest queries are still new to me, could it be that when no SortCriteria is defined it default's to the filter's, rather than the content type it returns?
|
|
|
|
Wow, really strange, I went away on lunch, iis worker process restarted, and now I'm able to view the query! without throwing the exception or erroring! http://imageshack.us/photo/my-images/832/queryl.png/
Maybe cache/syscache issue, will investigate further..
|
|
|
|
Yap, I can confirm with syscache module enable, deleting a sort criterion throws this exception, raising an issue now
|
|
|
|
done, issue raised here: http://orchard.codeplex.com/workitem/19227
|
|
|
|
Note. This problem also occurs when deleting a Filter from your query. Restarting IIS resolves the issue in this case too.
|
|