Skip to content

Commit 5ed09eb

Browse files
authored
Backport ShowUnroutableContentWarnings to V13 (#18479)
1 parent de2114b commit 5ed09eb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Umbraco.Core/Configuration/Models/ContentSettings.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ @keyframes umbraco-preview-badge--effect {{
160160
internal const bool StaticDisableUnpublishWhenReferenced = false;
161161
internal const bool StaticAllowEditInvariantFromNonDefault = false;
162162
internal const bool StaticShowDomainWarnings = true;
163+
internal const bool StaticShowUnroutableContentWarnings = true;
163164

164165
/// <summary>
165166
/// Gets or sets a value for the content notification settings.
@@ -285,4 +286,10 @@ @keyframes umbraco-preview-badge--effect {{
285286
/// </summary>
286287
[DefaultValue(StaticShowDomainWarnings)]
287288
public bool ShowDomainWarnings { get; set; } = StaticShowDomainWarnings;
289+
290+
/// <summary>
291+
/// Gets or sets a value indicating whether to show unroutable content warnings.
292+
/// </summary>
293+
[DefaultValue(StaticShowUnroutableContentWarnings)]
294+
public bool ShowUnroutableContentWarnings { get; set; } = StaticShowUnroutableContentWarnings;
288295
}

src/Umbraco.Web.BackOffice/Controllers/ContentController.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,11 @@ private void AddPublishRoutableErrorNotifications(
12781278
SimpleNotificationModel globalNotifications,
12791279
string[]? successfulCultures)
12801280
{
1281+
if (_contentSettings.ShowUnroutableContentWarnings is false)
1282+
{
1283+
return;
1284+
}
1285+
12811286
IContent? content = publishStatus.FirstOrDefault()?.Content;
12821287
if (content is null)
12831288
{

0 commit comments

Comments
 (0)