Fixes Publishing/Unpublishing variants and it's nuances
This commit is contained in:
@@ -194,15 +194,23 @@ namespace Umbraco.Core.Models
|
||||
Name = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ContentTypeBase.Variations.HasAny(ContentVariation.CultureNeutral | ContentVariation.CultureSegment))
|
||||
throw new NotSupportedException("Content type does not support varying name by culture.");
|
||||
|
||||
if (_names == null) return;
|
||||
if (_names == null) return;
|
||||
if (!_names.ContainsKey(culture))
|
||||
throw new InvalidOperationException($"Cannot unpublish culture {culture}, the document contains only cultures {string.Join(", ", _names.Keys)}");
|
||||
_names.Remove(culture);
|
||||
if (_names.Count == 0)
|
||||
_names = null;
|
||||
}
|
||||
|
||||
protected virtual void ClearNames()
|
||||
{
|
||||
{
|
||||
if (!ContentTypeBase.Variations.HasAny(ContentVariation.CultureNeutral | ContentVariation.CultureSegment))
|
||||
throw new NotSupportedException("Content type does not support varying name by culture.");
|
||||
|
||||
_names = null;
|
||||
OnPropertyChanged(Ps.Value.NamesSelector);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user