Skip to content

Commit 385a534

Browse files
CodeBunTesemmagarland
authored andcommitted
Update valid reasons not to have a template on a content node to include having a redirect field
1 parent 862e45e commit 385a534

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Umbraco.Web.Website/Routing/UmbracoRouteValuesFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,12 @@ private async Task<UmbracoRouteValues> CheckNoTemplateAsync(
128128
IPublishedRequest request = def.PublishedRequest;
129129

130130
// Here we need to check if there is no hijacked route and no template assigned but there is a content item.
131-
// If this is the case we want to return a blank page.
131+
// If this is the case we want to return a blank page, the only exception being if the content item has a redirect field present.
132132
// We also check if templates have been disabled since if they are then we're allowed to render even though there's no template,
133133
// for example for json rendering in headless.
134134
if (request.HasPublishedContent()
135135
&& !request.HasTemplate()
136+
&& !request.IsRedirect()
136137
&& !_umbracoFeatures.Disabled.DisableTemplates
137138
&& !hasHijackedRoute)
138139
{

0 commit comments

Comments
 (0)