advanced-cms / advanced-reviews

This is an Open Source add-on that improves the reviewing process and lets external users to view & review content items or whole projects without the need to access the Edit Mode. Created and maintained by Bartosz Sekuła and Grzegorz Wiecheć
Apache License 2.0
17 stars 15 forks source link

Stackoverflow when two pages reference each other in a content area #228

Closed Nhawdge closed 1 year ago

Nhawdge commented 1 year ago

I've found an issue that causes a stack overflow exception. When two pages are referencing each other within content areas, the advance reviews links will get stuck in a loop, until it causes a stack overflow. Below is a small excerpt of the overflow. This is on the latest version of Optimizely (as of Feb 9), and version 1.3.1 of Advanced Reviews.

Here is a repository that has the issue recreated, login admin Password1!

https://github.com/Nhawdge/AdvanceReviewsStackOverflow

  at Advanced.CMS.ExternalReviews.DraftContentLoader.TryGet[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](EPiServer.Core.ContentReference, EPiServer.Core.LoaderOptions, System.__Canon ByRef)
   at EPiServer.Core.Html.StringParsing.ContentFragment.GetContent(Boolean)
   at EPiServer.Core.Html.StringParsing.ContentFragment.CreateBaseTagBuilder(Boolean)
   at EPiServer.Core.Html.StringParsing.ContentFragment.get_InternalFormat()
   at EPiServer.Core.Html.StringParsing.StringFragmentCollection.MergeStringFragments(StringMode)
   at EPiServer.Core.ContentArea.CreateWriteableCloneImplementation()
   at EPiServer.SpecializedProperties.PropertyContentArea.CreateWritableClone()
   at EPiServer.Core.PropertyDataCollection.CreateWritableClone()
   at EPiServer.Core.ContentData.CreateWriteableCloneImplementation()
   at EPiServer.Core.PageData.CreateWriteableCloneImplementation()
   at EPiServer.Core.PageData.CreateWritableClone()
   at Advanced.CMS.ExternalReviews.ContentExtensions.AllowAccessToEveryone(EPiServer.Core.IContent)
   at Advanced.CMS.ExternalReviews.CustomContentLoaderInitialization.Events_LoadingContent(System.Object, EPiServer.ContentEventArgs)
   at EPiServer.Core.Internal.DefaultContentEvents.RaiseContentEvent(System.String, EPiServer.ContentEventArgs)
   at EPiServer.Core.Internal.DefaultContentLoader.TryGet[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](EPiServer.Core.ContentReference, EPiServer.Core.LoaderOptions, System.__Canon ByRef)
   at Advanced.CMS.ExternalReviews.DraftContentLoader.TryGet[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](EPiServer.Core.ContentReference, EPiServer.Core.LoaderOptions, System.__Canon ByRef)
   at EPiServer.Core.Html.StringParsing.ContentFragment.GetContent(Boolean)
   at EPiServer.Core.Html.StringParsing.ContentFragment.GetSecurityDescriptor()
   at EPiServer.Core.ContentAreaItem..ctor(EPiServer.Core.Html.StringParsing.ContentFragment)
   at EPiServer.Core.ContentArea.CreateContentAreaItem(EPiServer.Core.Html.StringParsing.ContentFragment)
   at System.Linq.Enumerable+SelectEnumerableIterator`2[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ToList()
   at System.Linq.Enumerable.ToList[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   at EPiServer.Core.ContentArea.GetOrCreateContentAreaItemCollection(EPiServer.Core.Html.StringParsing.StringFragmentCollection)
   at EPiServer.Core.ContentArea.get_Fragments()
   at EPiServer.Core.ContentArea.get_Items()
   at EPiServer.SpecializedProperties.PropertyContentArea.CreateWritableClone()
   at EPiServer.Core.PropertyDataCollection.CreateWritableClone()
   at EPiServer.Core.ContentData.CreateWriteableCloneImplementation()
   at EPiServer.Core.PageData.CreateWriteableCloneImplementation()
   at EPiServer.Core.PageData.CreateWritableClone()
   at Advanced.CMS.ExternalReviews.ContentExtensions.AllowAccessToEveryone(EPiServer.Core.IContent)
   at Advanced.CMS.ExternalReviews.CustomContentLoaderInitialization.Events_LoadingContent(System.Object, EPiServer.ContentEventArgs)
   at EPiServer.Core.Internal.DefaultContentEvents.RaiseContentEvent(System.String, EPiServer.ContentEventArgs)
   at EPiServer.Core.Internal.DefaultContentLoader.TryGet[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](EPiServer.Core.ContentReference, EPiServer.Core.LoaderOptions, System.__Canon ByRef)
   at Advanced.CMS.ExternalReviews.DraftContentLoader.TryGet[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](EPiServer.Core.ContentReference, EPiServer.Core.LoaderOptions, System.__Canon ByRef)
KongKvistad commented 1 year ago

I'm facing the same issue, except it seems to occur regardless of contentarea.

I'm on EPiServer.CMS Version="12.18.0". Any advice?

samuelthomson62 commented 1 year ago

Ran into this issue after an upgrade from EPiServer.CMS 12.15.0 => 12.17.1 and Advanced.CMS.AdvancedReview 1.3.1 => 1.3.2.

I tried downgrading Advanced.CMS.AdvancedReviews back to 1.3.1 but the bug still persists.

stevenstanley commented 1 year ago

I believe I am having the same issue with EPiServer.CMS 12.19.0. App seems to spin for a few seconds and then totally crash with a similar error to the original post.