U4-1287 - StackOverflowException in 4.11.1

Created by Jeroen Breuer 29 Nov 2012, 22:32:53 Updated by Sebastiaan Janssen 17 Jan 2013, 10:13:10

Duplicates: U4-1215

Sorry I'm not sure how I did it, but I'm getting a StackOverflowException. I have a documenttype, node, template and partial view all with the same name. Somehow this gives the StackOverflowException. Probably because it's causing an infinite loop.

Comments

Jeroen Breuer 29 Nov 2012, 22:35:44

The partial view is in the /Views/Partials folder.


Jeroen Breuer 29 Nov 2012, 22:41:46

The error seems to happen when I call my partial view:

@Html.Partial("Gallery1")

When I rename my partial view the error goes away.


Jeroen Mink 30 Nov 2012, 06:28:23

It probably works if you do @Html.Partial("Partials/Gallery1") I guess it's trying to load the Gallery1 view in the 'Views' folder instead of the partial.

Based on https://github.com/Shandem/Umbraco4Docs/blob/4.8.0/Documentation/Reference/Mvc/partial-views.md i would say it's a bug indeed


Stephan 30 Nov 2012, 09:24:03

At the moment the RenderViewEngine looks for ~/Views/Gallery1.cshtml before ~/Views/Partials/Gallery1.cshtml. The funny thing is that Shannon's done things the other way round in the PluginViewEngine, which looks first in Partials. I see what needs to be changed but I first would like Shannon's word on it.

That's in Umbraco.Web.Mvc.RenderViewEngine.cs:19


Steve Farron 04 Dec 2012, 15:38:55

I've run into this problem too. If a view or partial view calls itself recursively it'll do so until it runs off the stack. This was a wake-up call, as our naming conventions never had this architecture in mind. We just renamed the partial view and all is well.


Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category: Architecture

Backwards Compatible: False

Fix Submitted:

Affected versions: 4.10.0, 4.11.0, 4.11.1

Due in version: 6.0.0

Sprint:

Story Points:

Cycle: