jPlayer widget created with static error as result

Posted by goldengel on Stack Overflow See other posts from Stack Overflow or by goldengel
Published on 2011-06-26T21:56:01Z Indexed on 2011/06/29 8:22 UTC
Read the original article Hit count: 386

I've created a widged with Orchard. Unfortunately I've used the same "Title" for a jPlayer widget twice. Now I receive an error:

Server Error in '/wgk' Application. Sequence contains more than one element 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: Sequence contains more than one element

Source Error:

Line 2:  <fieldset>
Line 3:      <div>@Html.LabelFor(o => o.MediaGalleryName, @T("Media gallery"))</div>
Line 4:      @if(!Model.HasAvailableGalleries) {
Line 5:          <div>@T("You need first to create an media gallery on Media Gallery menu")</div>
Line 6:      }


Source File: x:\Intepub\wgk\Modules\Orchard.jPlayer\Views\EditorTemplates\Parts\MediaGallery.cshtml    Line: 4

Stack Trace:

[InvalidOperationException: Sequence contains more than one element]
   System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +4206966
   NHibernate.Linq.Visitors.ImmediateResultsVisitor`1.HandleSingleOrDefaultCall(MethodCallExpression call) +51
   NHibernate.Linq.Visitors.ImmediateResultsVisitor`1.VisitMethodCall(MethodCallExpression call) +411
   NHibernate.Linq.Visitors.ExpressionVisitor.Visit(Expression exp) +371

In MediaGallery.cshtml (found in error description above) is written:

@model Orchard.jPlayer.Models.MediaGalleryPart
<fieldset>
    <div>@Html.LabelFor(o => o.MediaGalleryName, @T("Media gallery"))</div>
    @if(!Model.HasAvailableGalleries) {
        <div>@T("You need first to create an media gallery on Media Gallery menu")</div>
    }
    else {
        <div>@Html.DropDownListFor(o => o.SelectedGallery, Model.AvailableGalleries)</div>

        <div>@Html.LabelFor(o => o.SelectedType, @T("Media gallery type"))</div>
        <div>@Html.DropDownListFor(o => o.SelectedType, Model.AvailableTypes)</div>
        <div>@Html.LabelFor(o => o.AutoPlay, @T("Auto play"))</div>
        <div>@Html.CheckBoxFor(o => o.AutoPlay)</div>
    }
</fieldset>

My problem is now, I cannot find or edit the widget with double used name. I would love to replace it to another name. But I do not know where to do this.

Please advice.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc