Copied to clipboard

Flag this post as spam?

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


  • Harry Spyrou 212 posts 604 karma points
    Jan 15, 2018 @ 10:28
    Harry Spyrou
    0

    Umbraco bugging out from time to time (Can't explain better in title)

    Hello everyone,

    I came across a problem a few times and each time it's stopping me a few days from accomplishing the things I need to accomplish. Here's the most recent example that actually got me pissed off.

    I'm on a tight schedule and I have this code (using Nested Content this time):

    @inherits Umbraco.Web.Mvc.UmbracoViewPage
    @using blabla.Web.Models;
    @{
        Layout = "MasterPage.cshtml";
    }
    @Html.Partial("_HomePageHeroBlock")
    
                                                                                    @*items collection*@
        @foreach (var item in Model.GetPropertyValue<IEnumerable<IPublishedContent>>("custFeedback2"))
        {
            //this takes the partial view name
            var partialViewName = "_" + item.DocumentTypeAlias;
            if (partialViewName == "_contactForm")
            {
    
                //if it matches the contact form name then render the contact form in a specific way with a specific model
                {Html.RenderPartial("_ContactForm", new BrochureRequestFormModel());}
            }
            else
            {
                //if it doesn't, then render the partial this way
                @Html.Partial(partialViewName, item);
            }
        }   
    

    Here's what happened. I tried doing that on Friday, but the outcome is going successfully through my code (I used breakpoints to check) and then it was deciding to render ONLY the contact form. For absolutely no reason.

    I tried cleaning the solution, building again, rebuilding, closing and opening Visual Studio, restarting the pc, threatening it, crying, performing satanic rituals, summoning Cthulu and the outcome was always the same. It would just freaking render ONLY the contact form.

    Eventually I gave up. I just went home. Came back today, opened the solution, BOOM works as intended. I've came across this problem a few times throughout the last years and I still don't know how to fix it on time. It almost threw me off my deadlines.

    Anyone have a clue?

  • Steve Morgan 1345 posts 4452 karma points c-trib
    Jan 15, 2018 @ 12:59
    Steve Morgan
    1

    Just to check... you weren't in Preview view were you?

    I was helping a new dev the other day and she had viewed a page in preview. Umbraco kind of gets stuck in that view until you close the preview. This means your changes aren't reflected on refresh?!

  • Harry Spyrou 212 posts 604 karma points
    Jan 15, 2018 @ 13:22
    Harry Spyrou
    0

    Hello! Thanks for the response. No I never use Preview exactly because I know it gets stuck. It feels like a global problem but it happens so rarely that I don't know when it actually happens and I spend a lot of time trying to fix a problem that's not there.

Please Sign in or register to post replies

Write your reply to:

Draft