Can't set winner in a contest

Vote:
 

Used the code in the SDK to submit answers to a contest. The answers get submitted and can be viewed in the EPiserver Community Administration UI. 

When clicking on the "Set as winner"-button on an entry, I receive the following runtime error:

Server Error in '/' Application.

Invalid use of read only object - Clone() it before making modifications.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Invalid use of read only object - Clone() it before making modifications.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[InvalidOperationException: Invalid use of read only object - Clone() it before making modifications.]
   EPiServer.Common.Cache.CacheableCollectionBase.ValidateReadOnly() +85
   EPiServer.Common.Cache.CacheableCollectionBase.OnInsert(Int32 index, Object value) +9
   System.Collections.CollectionBase.System.Collections.IList.Add(Object value) +83
   EPiServer.Common.Security.UserCollection.Add(IUser user) +44
   EPiServer.Community.Web.Administration.ContestInfoControl.dataListSubmissions_UpdateCommand(Object source, DataListCommandEventArgs e) +249
   System.Web.UI.WebControls.DataList.OnBubbleEvent(Object source, EventArgs e) +11101186
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70
   System.Web.UI.WebControls.DataListItem.OnBubbleEvent(Object source, EventArgs e) +96
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981



Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927 

 

Is this a bug?

#38058
Mar 28, 2010 20:05
Vote:
 

I just tried this out on a test site running CMS R2 SP2 and Community 3.2 SP1 (with hotfix 1 and 2), and I got the same error.

Seems to be a bug in the EPiServer.Community.Web.Administration.ContestInfoControl.dataListSubmissions_UpdateCommand method where a User is added to a readonly UserCollection (instead of the UserCollection being cloned before adding the User, which would be the correct way of doing it). Could this be the case?

 

#38060
Mar 29, 2010 9:37
Vote:
 

Yes, this is a known issue. I don't think the fix has yet been released as port of a public update, but Support has a fix available.

http://world.episerver.com/Support/Register-Support-Incident/

#38100
Mar 29, 2010 20:30
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.