Products Sample - ProductDetailsView template error - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Products Sample - ProductDetailsView template error

  • Products Sample - ProductDetailsView template error
  • I'm running the Products sample code from SP1 but it crashes with the following exception when using the ProductsView widget on a page.

    The problem seems to be it can't find the embedded template ProductCatalogSample.Web.UI.Public.FrontendProductsDetailsView.ascx, because when you try and edit the detail template - Full Product it is blank.

    I've looked at the sample code for ProductDetailsView but am struggling to find where the problem is, any ideas ?

    Thanks
    Euan

    Type : System.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Message : More than one item in the sequence.
    Source : Telerik.Sitefinity
    Help link :
    Data : System.Collections.ListDictionaryInternal
    TargetSite : System.Object ExecuteKnownType[TResult](Telerik.OpenAccess.IObjectScope, System.String, Boolean, Int32, Int32, System.Collections.IList, Telerik.Sitefinity.Data.Linq.ElementOperator)
    Stack Trace :    at Telerik.Sitefinity.Data.Linq.Oql.OqlQueryProvider`2.ExecuteKnownType[TResult](IObjectScope scope, String queryText, Boolean isEnumerable, Int32 skip, Int32 take, IList parameters, ElementOperator op)
       at Telerik.Sitefinity.Data.Linq.Oql.OqlQueryProvider`2.Execute[TResult](Expression expression)
       at Telerik.Sitefinity.Data.Linq.QueryProvider`2.System.Linq.IQueryProvider.Execute[T](Expression expression)
       at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)
       at Telerik.Sitefinity.Web.UI.ControlUtilities.GetControlTemplate(String key, Expression`1 predicate)
       at Telerik.Sitefinity.Web.UI.ControlUtilities.GetTemplate(TemplateInfo info)
       at Telerik.Sitefinity.Web.UI.ContentUI.Views.Backend.ViewBase.get_LayoutTemplate()
       at Telerik.Sitefinity.Web.UI.ContentUI.Views.Backend.ViewBase.get_Container()
       at Telerik.Sitefinity.Web.UI.ContentUI.Views.Backend.ViewBase.CreateChildControls()
       at System.Web.UI.Control.EnsureChildControls()
       at System.Web.UI.WebControls.CompositeControl.get_Controls()
       at Telerik.Sitefinity.Web.UI.ContentUI.ContentView.LoadView(String viewName)
       at Telerik.Sitefinity.Web.UI.ContentUI.ContentView.CreateChildControls()
       at System.Web.UI.Control.EnsureChildControls()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Control.PreRenderRecursiveInternal()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     
    Additional Info:
     
    MachineName : WG-CW-SDEV2A
    TimeStamp : 04/03/2011 09:18:50
    FullName : Telerik.Sitefinity.Utilities, Version=4.0.1210.0, Culture=neutral, PublicKeyToken=b28c218413bdf563


  • Hi Euan,

    I tried to reproduce your issue but to could not get to success. Is this a brand new installation or upgrade?

    Can you send us this scenario into an isolated sample project so we can try it there?


    All the best,
    George
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  • Hi George,

    It is a brand new installation. I just registered the product sample module, then created a new page dropped the product widget onto it. Then if you close the page and reopen it or view the published page it errors.

    I've submitted my sample project as ticket 402440

    Thanks
    Euan

  • Hi George/Euan,

    Has there been a resolution for this issue with "More than one item in the sequence"? I am receiving exactly the same error.

    Thanks
    Al
  • One quick note on this issue - I have noticed that there are duplicate widget templates for the products module i.e. each template exists twice.

    One other thing, on the widget templates page, the module name shows as "null" unlike News/Blogs etc.

    Al
  • Hi Higgsy,

    As mentioned in my other post, I see the duplicates happening every time I build my Module then Site, the templates get reinstalled and are duplicated. If you build again there will be 3x, 4x etc. Only way around it is to restore clean database and restore site before every build.

    Also for the template error I'm having this one too. I only have it when in the MasterListView.cs I try to get the module to use my own FrontEndTemplates as follows:
    // This works, gets added with template code available for editing
      internal const string titlesOnlyLayoutTemplateName = "Telerik.Sitefinity.Resources.Templates.Frontend.News.TitlesOnlyListView.ascx";
     // This template is added but when you edit there is nothing there  yes, the ascx file is set as embedded resource.
     internal const string titlesThumbnailSummaryTemplateName = "ProductCatalog.Resources.Templates.Frontend.Products.TitlesThumbnailsListView.ascx";


    The template is added but if you edit it there is actually no content. If I manually paste in the code from the .ascx file then the "More than one item in the sequence" error goes away. Not sure if this is same issue but very well could be.

    Again, I really wonder if anyone at Telerik has actually tried to use the sample Products module as all these issues are so easy to reproduce.

    Hope that helps.
    Phill
  • Phil,

    I hadn't looked at the widget templates section for a while, I've just looked and there are 3 pages of the damn things!

    Telerik - can you please provide a solution.

    Thanks
    higgsy
  • @higgsy, I could be mistaken but I'm pretty sure this is a new bug introduced with SP1, I don't remember getting multiple templates added before SP1. Also, if you have the lated SDK code you'll noticed the Taxonomies sample they added (the Blue/Red drop down) also gets installed with every build and eventually you'll have multiple duplicate values in that drop down as well...

    I'm really starting to kick myself for betting on Sitefinity/Telerik, it's costing me daily as well as lost potential business because my clients are losing faith in me as well.

    p.
  • Hi George,

    Were you able to reproduce this problem, with the project I supplied ?


    Euan
  • 256846_ProductsCatalogSample-fix-no-dlls.zip
    Hi guys,

    Right, we have fixed this bug and I've attached the latest version of the ProductsModule sample which include the fix. This will go public with the next release.

    All the best,
    George
    the Telerik team
  • Hi George,

    To simplify the merge process can you let us know which files changed? Is is just the ProductsModule.cs file or do we need to do a merge/compare on all files? I'm looking to merge this fix into a module that is being customized and in progress. I know I can do this on my own but figured I'd ask just in case you might know which file changed.

    Thanks for the fix!! Now if we could just get a sample with Image and Page selectors integrated I think we'd have a lot of happy devs!

    Cheers,
    Phill
  • George,

    "Now if we could just get a sample with Image and Page selectors integrated I think we'd have a lot of happy devs"

    I'll second that.  A bunch of us, I'm sure, are chomping at the bit for this one.

    Happy to see a fixed Products Module for the dropdown/taxonomy case though.

    - William
  • Hi George, Can we clarify which bug(s) have been fixed? What about the issue with the templates appearing multiple times? I'd also third the comment regarding page and image selectors. It's pretty hard to find a use for a module that wouldn't need this functionality, and I suspect I'm not alone in saying that the hardest thing about V4 is trying to select content - we desperately need some examples, please please please! Regards, Higgsy
  • Hi,

    Here is the list of fixes that George sent me.

    A few things were modified,

    a) a new method for template registration called RegisterTemplateEmbeddedInProductsModule has been added to the ProductsModule.cs . It adds duplicate templates verification logic.

    b) three new templates are introduced: TitlesOnlyListView.ascx, TitlesDatesListView.ascx, TitlesDatesSummariesListView.ascx and TitlesDatesContentsListView.ascx

    c) the templates in MasterListView.cs were incorrect and were changed to the correct ones.

    Euan