OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

NHibernate Exception in ContentPickerField Loading #8744

Open AndreaPiovanelli opened 7 months ago

AndreaPiovanelli commented 7 months ago

https://github.com/OrchardCMS/Orchard/blob/9644ceda1f9b077d44aaa4ffaab103c19a59ddba/src/Orchard.Web/Modules/Orchard.ContentPicker/Handlers/ContentPickerFieldHandler.cs#L31C19-L31C19

This line triggers the following exception:

Orchard.Exceptions.DefaultExceptionPolicy - TenantName - An unexpected exception was caught [https://localhost/OrchardLocal/tenantname/]
NHibernate.HibernateException: Found shared references to a collection: Orchard.ContentManagement.Records.ContentItemRecord.Versions
in NHibernate.Engine.Collections.ProcessReachableCollection(IPersistentCollection collection, CollectionType type, Object entity, ISessionImplementor session)
   in NHibernate.Event.Default.FlushVisitor.ProcessCollection(Object collection, CollectionType type)
   in NHibernate.Event.Default.AbstractVisitor.ProcessEntityPropertyValues(Object[] values, IType[] types)
   in NHibernate.Event.Default.DefaultFlushEntityEventListener.OnFlushEntity(FlushEntityEvent event)
   in NHibernate.Event.Default.AbstractFlushingEventListener.FlushEntities(FlushEvent event)
   in NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event)
   in NHibernate.Event.Default.DefaultAutoFlushEventListener.OnAutoFlush(AutoFlushEvent event)
   in NHibernate.Impl.SessionImpl.AutoFlushIfRequired(ISet`1 querySpaces)
   in NHibernate.Impl.SessionImpl.List[T](CriteriaImpl criteria)
   in NHibernate.Impl.CriteriaImpl.List[T]()
   in Orchard.ContentManagement.DefaultContentManager.GetManyImplementation(QueryHints hints, Action`2 predicate)
   in Orchard.ContentManagement.DefaultContentManager.GetMany[T](IEnumerable`1 ids, VersionOptions options, QueryHints hints)
   in Orchard.ContentManagement.Utilities.LazyField`1.GetValue()
   in Orchard.ContentManagement.Utilities.LazyField`1.get_Value()
   in Orchard.ContentPicker.Fields.ContentPickerField.get_ContentItems()