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

Orchard.Taxonomies.Handlers.TermsPartHandler: Lifetime scope already disposed when accessing LazyField #8765

Closed AndreaPiovanelli closed 3 months ago

AndreaPiovanelli commented 4 months ago

https://github.com/OrchardCMS/Orchard/blob/50d416c9f2b1ebecd56bfbb0c8933768493fc89f/src/Orchard.Web/Modules/Orchard.Taxonomies/Handlers/TermsPartHandler.cs#L67

When accessing TermsPart.Record (which is a LazyField - https://github.com/OrchardCMS/Orchard/blob/50d416c9f2b1ebecd56bfbb0c8933768493fc89f/src/Orchard/ContentManagement/ContentPart.cs#L127) inside a delegate, it sometimes throws a ObjectDisposedException because the lifetime scope has already been disposed.