Backport ShowUnroutableContentWarnings to V13 (#18479)

This commit is contained in:
Kenn Jacobsen
2025-02-26 20:13:27 +01:00
committed by GitHub
parent de2114b8c5
commit 5ed09ebefa
2 changed files with 12 additions and 0 deletions

View File

@@ -160,6 +160,7 @@ public class ContentSettings
internal const bool StaticDisableUnpublishWhenReferenced = false;
internal const bool StaticAllowEditInvariantFromNonDefault = false;
internal const bool StaticShowDomainWarnings = true;
internal const bool StaticShowUnroutableContentWarnings = true;
/// <summary>
/// Gets or sets a value for the content notification settings.
@@ -285,4 +286,10 @@ public class ContentSettings
/// </summary>
[DefaultValue(StaticShowDomainWarnings)]
public bool ShowDomainWarnings { get; set; } = StaticShowDomainWarnings;
/// <summary>
/// Gets or sets a value indicating whether to show unroutable content warnings.
/// </summary>
[DefaultValue(StaticShowUnroutableContentWarnings)]
public bool ShowUnroutableContentWarnings { get; set; } = StaticShowUnroutableContentWarnings;
}

View File

@@ -1278,6 +1278,11 @@ public class ContentController : ContentControllerBase
SimpleNotificationModel globalNotifications,
string[]? successfulCultures)
{
if (_contentSettings.ShowUnroutableContentWarnings is false)
{
return;
}
IContent? content = publishStatus.FirstOrDefault()?.Content;
if (content is null)
{