@@ -41,7 +41,8 @@ internal class NotFoundHandlerHelper
41
41
IContentErrorPage [ ] error404Collection ,
42
42
IEntityService entityService ,
43
43
IPublishedContentQuery publishedContentQuery ,
44
- CultureInfo errorCulture )
44
+ CultureInfo errorCulture ,
45
+ int ? domainContentId )
45
46
{
46
47
if ( error404Collection . Length > 1 )
47
48
{
@@ -50,11 +51,11 @@ internal class NotFoundHandlerHelper
50
51
?? error404Collection . FirstOrDefault ( x => x . Culture == "default" ) ; // there should be a default one!
51
52
52
53
if ( cultureErr != null )
53
- return GetContentIdFromErrorPageConfig ( cultureErr , entityService , publishedContentQuery ) ;
54
+ return GetContentIdFromErrorPageConfig ( cultureErr , entityService , publishedContentQuery , domainContentId ) ;
54
55
}
55
56
else
56
57
{
57
- return GetContentIdFromErrorPageConfig ( error404Collection . First ( ) , entityService , publishedContentQuery ) ;
58
+ return GetContentIdFromErrorPageConfig ( error404Collection . First ( ) , entityService , publishedContentQuery , domainContentId ) ;
58
59
}
59
60
60
61
return null ;
@@ -67,7 +68,7 @@ internal class NotFoundHandlerHelper
67
68
/// <param name="entityService"></param>
68
69
/// <param name="publishedContentQuery"></param>
69
70
/// <returns></returns>
70
- internal static int ? GetContentIdFromErrorPageConfig ( IContentErrorPage errorPage , IEntityService entityService , IPublishedContentQuery publishedContentQuery )
71
+ internal static int ? GetContentIdFromErrorPageConfig ( IContentErrorPage errorPage , IEntityService entityService , IPublishedContentQuery publishedContentQuery , int ? domainContentId )
71
72
{
72
73
if ( errorPage . HasContentId ) return errorPage . ContentId ;
73
74
@@ -92,7 +93,7 @@ internal class NotFoundHandlerHelper
92
93
//we have an xpath statement to execute
93
94
var xpathResult = UmbracoXPathPathSyntaxParser . ParseXPathQuery (
94
95
xpathExpression : errorPage . ContentXPath ,
95
- nodeContextId : null ,
96
+ nodeContextId : domainContentId ,
96
97
getPath : nodeid =>
97
98
{
98
99
var ent = entityService . Get ( nodeid ) ;
0 commit comments