From e4837d1962d52eb6fa48762402af7fb89fff6b01 Mon Sep 17 00:00:00 2001 From: Jeavon Leopold Date: Mon, 9 Jun 2014 08:41:29 +0100 Subject: [PATCH] Changing DescendantOrSelf to DescendantOrSelf.First as it doesn't work with dynamics --- .../Editors/TemplateQuery/TemplateQueryController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/Editors/TemplateQuery/TemplateQueryController.cs b/src/Umbraco.Web/Editors/TemplateQuery/TemplateQueryController.cs index 420fdf9484..6fdf18186e 100644 --- a/src/Umbraco.Web/Editors/TemplateQuery/TemplateQueryController.cs +++ b/src/Umbraco.Web/Editors/TemplateQuery/TemplateQueryController.cs @@ -86,11 +86,11 @@ namespace Umbraco.Web.Editors timer.Start(); - currentPage = currentPage.DescendantOrSelf(fromTypeAlias); + currentPage = currentPage.DescendantsOrSelf(fromTypeAlias).FirstOrDefault(); timer.Stop(); - - sb.AppendFormat(".DescendantOrSelf(\"{0}\")", fromTypeAlias); + + sb.AppendFormat(".DescendantsOrSelf(\"{0}\").First()", fromTypeAlias); } // TYPE to return if filtered by type