Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simeon Ostberg 123 posts 389 karma points
    May 03, 2017 @ 15:24
    Simeon Ostberg
    0

    Portfolio item not working

    Hello everyone,

    I just discovered a strange problem with the portfolio item:

    I have two language trees (German and English). When I add a portfolio section on any page (no matter which tree), the page loads up normally. As soon as I add a portfolio item on the page, different things happen:

    • On the German tree it takes unusually long to save the item (the system including the front end kind of hangs), but then the item is visible on the page and working.
    • On the English tree the item is saved regularly, but when I open the page, it displays an error message and the page doesn't load regularly.

    Is there any place, where I can look to solve this?

    Thanks a lot, Simeon

  • Simeon Ostberg 123 posts 389 karma points
    May 04, 2017 @ 12:20
    Simeon Ostberg
    0

    Hello everyone,

    a programmer found a possible source of the error:enter image description here

    He said, the problem is with counting items in the virtual nodes, but can't dive deeply into the structure.

    I would be happy, if someone would know, where to look for solving this error.

    Thanks a lot, Simeon

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    May 05, 2017 @ 11:37
    Alex Skrypnyk
    0

    Hi Simeon

    Can you share the code with us?

    Thanks,

    Alex

  • Simeon Ostberg 123 posts 389 karma points
    May 05, 2017 @ 13:39
    Simeon Ostberg
    0

    Hi Alex,

    Which code do you mean? SectionPortfolio.cshtml?

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<SectionPortfolio>
    
    @using DotSee.UmbracoExtensions;
    @using DotSee.Portfolio;
    
    @{
        SectionPortfolio currSection = Model;
    
        PortfolioHelper portfolioHelper = PortfolioHelperMaker.GetCachedPortfolioHelper(ApplicationContext, currSection);
    
        string containerTypeClass = (portfolioHelper.Masonry) ? "masonry" : "grid";
        string spacingClass = (portfolioHelper.Spacing) ? "spacing" : "";
        string itemClass = (portfolioHelper.Spacing) ? "container-" + containerTypeClass + " nf-col-" + portfolioHelper.NoOfCols : "row container-" + containerTypeClass + " nf-col-" + portfolioHelper.NoOfCols;
        string containerClass = (portfolioHelper.Wide) ? "container-fluid" : "container";
        int cropwidth = (portfolioHelper.Wide)
            ? (portfolioHelper.Spacing) ? 877 : 952
            : (portfolioHelper.Spacing)? 650: 600;
    
    }
    
    <section id="[email protected]()" class="@currSection.GetSectionEffectCssClass() ptb-60 ptb-sm-60 text-center">
        <div class="@containerClass">
            <h3>@currSection.Name</h3>
            <div class="spacer-30"></div>
            @if (portfolioHelper.HasCategories)
            {
            <div class="row">
                <ul class="container-filter categories-filter">
                    @if (!currSection.HideAllCategoryOption)
                    {
                        string allCatsLabel = currSection.AllOptionLabel;
                        if (currSection.ShowItemCount) {
                            allCatsLabel += string.Format(" ({0})", portfolioHelper.GetTotalCount().ToString());
                        }
                    <li><a class="categories active" data-filter="*">@allCatsLabel</a></li>
                    }
    
                    @foreach (DGenericCategoryItem c in portfolioHelper.GetCategories())
                    {
                        string filter = c.Id.ToString();
                        string name = c.Name;
                        if (currSection.ShowItemCount) {
                            name += string.Format(" ({0})", portfolioHelper.GetCountPerCategory(c).ToString());
                        }
                        <li><a class="categories" data-filter=".@filter">@name</a></li>
                    }
                </ul>
            </div>
            }
    
    
            <div class="@itemClass">
    
                @foreach (PagePortfolioItem item in portfolioHelper.GetPortfolioItems())
                {
                    bool hideCategories = item.DoNotDisplayCategories;
                    bool hideDates = item.DoNotDisplayReleaseDate;
    
                    //Get the category names as a comma delimited list for display
                    string categoryNames = item.GetPortfolioCategoryNames();
    
                    //Get the ids and drop commas - those will be in the class attribute for script to work
                    string itemCategories = item.Categories;
                    string itemCategoriesNoCommas = itemCategories.Replace(" ", "").Replace(",", " ");
    
                    string imageThumb = "";
                    string imageFull = "";
                    //string imageTitle;
                    int counter = 0;
    
                    //TODO: Get image from media and image cropped correctly
                    IPublishedContent mediaItem = item.GetPortfolioListImage();
    
    
                    if (mediaItem == null)
                    {
                        imageThumb = "/img/noimage/gallery_noimage.png";
    
                    }
                    else
                    {
                        imageThumb = (currSection.Masonry) ? mediaItem.GetCropUrl(width: 800, imageCropMode: global::Umbraco.Web.Models.ImageCropMode.Max) : mediaItem.GetCropUrl(cropwidth, 350);
                    }
    
                    counter++;
    
                    <div class="nf-item @itemCategoriesNoCommas @spacingClass">
                        <div class="item-box">
                            <a href="@item.Url" title="@item.GetPageTitleForMenu()">
                                <img class="item-container" src="@imageThumb" alt="@counter" />
                                <div class="item-mask">
                                    <div class="item-caption">
                                        <h5 class="white">@item.GetPageTitleForMenu()</h5>
                                            <p class="white">
                    @Html.Raw(item.Summary)
                </p>
    
                                        @if (!currSection.DoNotDisplayCategories && !hideCategories)
                                        {
                                            <p class="white">@categoryNames</p>
                                        }
    
                                    </div>
                                </div>
                            </a>
                        </div>
                    </div>
                }
    
            </div>
        </div>
    
    </section>
    

    The Stack trace is:

    [IndexOutOfRangeException: Index was outside the bounds of the array.]
    
    
    DotSee.VirtualNodes.VirtualNodesUrlProvider.ConstructUrl(UmbracoContext umbracoContext, Int32 id, Uri current, UrlProviderMode mode, IPublishedContent content) +1125
       DotSee.VirtualNodes.VirtualNodesUrlProvider.GetUrl(UmbracoContext umbracoContext, Int32 id, Uri current, UrlProviderMode mode) +347
       Umbraco.Web.Routing.<>c__DisplayClass3.<GetUrl>b__0(IUrlProvider provider) +50
       System.Linq.WhereSelectArrayIterator`2.MoveNext() +82
       System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +215
       Umbraco.Web.Routing.UrlProvider.GetUrl(Int32 id, Uri current, UrlProviderMode mode) +236
       Umbraco.Web.Models.PublishedContentBase.get_Url() +184
       ASP._Page_Views_Partials_SectionPortfolio_cshtml.Execute() in c:\StarBase\StarBase.Staging\Views\Partials\SectionPortfolio.cshtml:85
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +126
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +125
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +140
       System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +147
       ASP._Page_Views_Partials_PageSectionRenderer_cshtml.Execute() in c:\StarBase\StarBase.Staging\Views\Partials\PageSectionRenderer.cshtml:48
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +126
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +125
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +140
       System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +147
       ASP._Page_Views_pageInner_cshtml.Execute() in c:\StarBase\StarBase.Staging\Views\pageInner.cshtml:23
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +126
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +110
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +140
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +380
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +109
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +97
       System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +241
       System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
       System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
    

    Thanks,

    Simeon

  • Simeon Ostberg 123 posts 389 karma points
    May 16, 2017 @ 09:50
    Simeon Ostberg
    0

    Hi!

    Unfortunately I just realized, that the blog post item brings up the same error message and the same behaviour (working on German language tree, not working on English language tree):

    Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

    Line 51:                             }
    Line 52: 
    Line 53:                             <span>@item.GetPostDate()</span></div>
    Line 54:                      
    Line 55:                             <div class="post-header">
    

    Source File: c:\Umbraco\Views\pageBlogList.cshtml Line: 53

    Stack Trace:

    [IndexOutOfRangeException: Index was outside the bounds of the array.]
       DotSee.VirtualNodes.VirtualNodesUrlProvider.ConstructUrl(UmbracoContext umbracoContext, Int32 id, Uri current, UrlProviderMode mode, IPublishedContent content) +1125
       DotSee.VirtualNodes.VirtualNodesUrlProvider.GetUrl(UmbracoContext umbracoContext, Int32 id, Uri current, UrlProviderMode mode) +347
       Umbraco.Web.Routing.<>c__DisplayClass3.<GetUrl>b__0(IUrlProvider provider) +50
       System.Linq.WhereSelectArrayIterator`2.MoveNext() +82
       System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +215
       Umbraco.Web.Routing.UrlProvider.GetUrl(Int32 id, Uri current, UrlProviderMode mode) +236
       Umbraco.Web.Models.PublishedContentBase.get_Url() +184
       ASP._Page_Views_pageBlogList_cshtml.Execute() in c:\Umbraco\Views\pageBlogList.cshtml:53
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +126
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +110
       Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +140
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +380
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +109
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +97
       System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +241
       System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
       System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +51
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
    

    I would be really grateful, if anyone had an idea...

    Thanks!

    Simeon

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    May 17, 2017 @ 11:46
    Alex Skrypnyk
    0

    Hi Simeon

    Can you show Source File: c:\Umbraco\Views\pageBlogList.cshtml Line: 53 ?

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    May 21, 2017 @ 20:50
    Alex Skrypnyk
    0

    Hi Simeon

    Did you solve this issue? can you share with the community?

    Thanks,

    Alex

  • Simeon Ostberg 123 posts 389 karma points
    May 23, 2017 @ 08:58
    Simeon Ostberg
    0

    Hi Alex,

    Sorry, I didn't get your previous reply. No, the issue is still unsolved. The code of the line is:

    <span>@item.GetPostDate()</span></div>
    

    Thanks a lot!

    Simeon

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    May 24, 2017 @ 08:53
    Alex Skrypnyk
    0

    Hi Simeon

    Can you look at source code of 'GetPostDate' method?

  • Simeon Ostberg 123 posts 389 karma points
    May 26, 2017 @ 07:50
    Simeon Ostberg
    0

    Hi Alex,

    Please excuse my late reply! What do you mean with source code? Isn't the line I posted the source code?

    Or do you mean the code section after opening the page?

    Best, Simeon

  • Simeon Ostberg 123 posts 389 karma points
    Nov 07, 2017 @ 14:51
    Simeon Ostberg
    0

    Hi everyone,

    Now, much later I can at least post a possible solution for the portfolio item.

    I found this post: https://our.umbraco.org/projects/starter-kits/umazel-starter-kit-responsive-bootstrap-theme/umazel-starter-kit-general-discussion/87436-index-out-of-bounds-with-multi-lingual-setup#comment-277193

    And by taking out the line out of web.config

    <add key="virtualnode" value="folderArticlePosts,folderSections,folderPortfolioItems,sectionPortfolio" />
    

    it now seems to work.

    Unfortunately blog post page still doesn't work - but hey, maybe I find that as well...

    Best, Simeon

Please Sign in or register to post replies

Write your reply to:

Draft