Skip to content

Commit 38358ab

Browse files
author
Dennis Öhman
committed
Filter out complex properties
1 parent 15058c4 commit 38358ab

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/Our.Umbraco.CopyVariant/App_Plugins/Our.Umbraco.CopyVariant/contentapp.controller.js

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
vm.properties.push({
5151
alias: property.alias,
5252
name: property.label,
53+
isDisabled: property.editor === "Umbraco.NestedContent" || property.editor === "Umbraco.BlockList",
5354
copy: false,
5455
});
5556
}

src/Our.Umbraco.CopyVariant/App_Plugins/Our.Umbraco.CopyVariant/contentapp.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h5>Copy..</h5>
1515
<div class="umb-checkboxlist">
1616
<ul class="unstyled">
1717
<li ng-repeat="item in vm.properties track by item.alias">
18-
<umb-checkbox name="paroperty" value="{{::item.alias}}" model="item.copy" text="{{::item.name}}"></umb-checkbox>
18+
<umb-checkbox disabled="item.isDisabled" name="paroperty" value="{{::item.alias}}" model="item.copy" text="{{::item.name}}"></umb-checkbox>
1919
</li>
2020
</ul>
2121
</div>

src/Our.Umbraco.CopyVariant/Controllers/CopyVariantApiController.cs

+6
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,14 @@ public bool CopyCulture(CopyCulture model)
5151
Services.ContentService.Save(content);
5252
}
5353

54+
var complexProperty = new string[] {
55+
global::Umbraco.Core.Constants.PropertyEditors.Aliases.NestedContent,
56+
global::Umbraco.Core.Constants.PropertyEditors.Aliases.BlockList
57+
};
58+
5459
foreach (var property in content.Properties.Where(x =>
5560
x.PropertyType.VariesByCulture() &&
61+
!complexProperty.Contains(x.PropertyType.Alias) &&
5662
(model.Properties.Any() && model.Properties.Contains(x.Alias))
5763
))
5864
{

0 commit comments

Comments
 (0)