From 71de4dc7ded06585ca5862cec59bcdf972dce20c Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 18 Mar 2014 14:28:05 +1100 Subject: [PATCH] Fixes: U4-3675 [NonAction] attribute should be ignored by Umbraco RenderActionInvoker --- src/Umbraco.Web/Mvc/RenderActionInvoker.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Mvc/RenderActionInvoker.cs b/src/Umbraco.Web/Mvc/RenderActionInvoker.cs index 4fa9702a61..f4efc6a570 100644 --- a/src/Umbraco.Web/Mvc/RenderActionInvoker.cs +++ b/src/Umbraco.Web/Mvc/RenderActionInvoker.cs @@ -1,3 +1,4 @@ +using System.Linq; using System.Web.Mvc; namespace Umbraco.Web.Mvc @@ -25,7 +26,13 @@ namespace Umbraco.Web.Mvc //check if the controller is an instance of IRenderMvcController if (controllerContext.Controller is IRenderMvcController) { - return new ReflectedActionDescriptor(controllerContext.Controller.GetType().GetMethod("Index"), "Index", controllerDescriptor); + return new ReflectedActionDescriptor( + controllerContext.Controller.GetType().GetMethods() + .First(x => x.Name == "Index" && + x.GetCustomAttributes(typeof (NonActionAttribute), false).Any() == false), + "Index", + controllerDescriptor); + } } return ad;