Skip to content

Commit

Permalink
Update valid reasons not to have a template on a content node to incl…
Browse files Browse the repository at this point in the history
…ude having a redirect field
  • Loading branch information
CodeBunTes authored and emmagarland committed Aug 25, 2024
1 parent 862e45e commit 385a534
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Umbraco.Web.Website/Routing/UmbracoRouteValuesFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,12 @@ private async Task<UmbracoRouteValues> CheckNoTemplateAsync(
IPublishedRequest request = def.PublishedRequest;

// Here we need to check if there is no hijacked route and no template assigned but there is a content item.
// If this is the case we want to return a blank page.
// 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.
// We also check if templates have been disabled since if they are then we're allowed to render even though there's no template,
// for example for json rendering in headless.
if (request.HasPublishedContent()
&& !request.HasTemplate()
&& !request.IsRedirect()
&& !_umbracoFeatures.Disabled.DisableTemplates
&& !hasHijackedRoute)
{
Expand Down

0 comments on commit 385a534

Please sign in to comment.