From ceaeb7c1df21e0b7ca88fca147727745f5c771b6 Mon Sep 17 00:00:00 2001 From: brunoAltinet Date: Thu, 17 Oct 2024 11:11:20 +0200 Subject: [PATCH 1/2] fix: added IsNew and TypePartDefinition to viewmodel --- .../Drivers/BooleanFieldDisplayDriver.cs | 2 ++ .../Drivers/ContentPickerFieldDisplayDriver.cs | 3 ++- .../Drivers/DateFieldDisplayDriver.cs | 2 ++ .../Drivers/DateTimeFieldDisplayDriver.cs | 2 ++ .../Drivers/HtmlFieldDisplayDriver.cs | 2 ++ .../Drivers/LinkFieldDisplayDriver.cs | 2 ++ .../LocalizationSetContentPickerFieldDisplayDriver.cs | 2 ++ .../Drivers/MultiTextFieldDisplayDriver.cs | 2 ++ .../Drivers/NumericFieldDisplayDriver.cs | 3 +++ .../Drivers/TextFieldDisplayDriver.cs | 2 ++ .../Drivers/TimeFieldDisplayDriver.cs | 2 ++ .../Drivers/UserPickerFieldDisplayDriver.cs | 1 + .../Drivers/YoutubeFieldDisplayDriver.cs | 2 ++ .../ViewModels/EditBooleanFieldViewModel.cs | 5 +++++ .../ViewModels/EditContentPickerFieldViewModel.cs | 5 ++++- .../ViewModels/EditDateFieldViewModel.cs | 5 +++++ .../ViewModels/EditDateTimeFieldViewModel.cs | 5 +++++ .../ViewModels/EditHtmlFieldViewModel.cs | 5 +++++ .../ViewModels/EditLinkFieldViewModel.cs | 5 +++++ .../EditLocalizationSetContentPickerFieldViewModel.cs | 5 +++++ .../ViewModels/EditMultiTextFieldViewModel.cs | 4 ++++ .../ViewModels/EditNumericFieldViewModel.cs | 5 +++++ .../ViewModels/EditTextFieldViewModel.cs | 5 +++++ .../ViewModels/EditTimeFieldViewModel.cs | 5 +++++ .../ViewModels/EditUserPickerFieldViewModel.cs | 3 +++ .../ViewModels/EditYoutubeFieldViewModel.cs | 5 +++++ 26 files changed, 87 insertions(+), 2 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/BooleanFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/BooleanFieldDisplayDriver.cs index 50eec36a191..eab63ee531b 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/BooleanFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/BooleanFieldDisplayDriver.cs @@ -31,6 +31,8 @@ public override IDisplayResult Edit(BooleanField field, BuildFieldEditorContext model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/ContentPickerFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/ContentPickerFieldDisplayDriver.cs index 04345e9a5bd..fc9e6ac7fde 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/ContentPickerFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/ContentPickerFieldDisplayDriver.cs @@ -63,7 +63,8 @@ public override IDisplayResult Edit(ContentPickerField field, BuildFieldEditorCo model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; - + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; model.SelectedItems = []; var settings = context.PartFieldDefinition.GetSettings(); diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateFieldDisplayDriver.cs index 6c9c4667bae..7758b262cbc 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateFieldDisplayDriver.cs @@ -39,6 +39,8 @@ public override IDisplayResult Edit(DateField field, BuildFieldEditorContext con model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateTimeFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateTimeFieldDisplayDriver.cs index e8ebd8468d5..30e8f9d8252 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateTimeFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateTimeFieldDisplayDriver.cs @@ -47,6 +47,8 @@ public override IDisplayResult Edit(DateTimeField field, BuildFieldEditorContext model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/HtmlFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/HtmlFieldDisplayDriver.cs index d5ab2b82086..e819e351bc4 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/HtmlFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/HtmlFieldDisplayDriver.cs @@ -75,6 +75,8 @@ public override IDisplayResult Edit(HtmlField field, BuildFieldEditorContext con model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LinkFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LinkFieldDisplayDriver.cs index 3088e6580a3..e9597145dfb 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LinkFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LinkFieldDisplayDriver.cs @@ -61,6 +61,8 @@ public override IDisplayResult Edit(LinkField field, BuildFieldEditorContext con model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LocalizationSetContentPickerFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LocalizationSetContentPickerFieldDisplayDriver.cs index 878fd3a93e3..2bb7cd21a1f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LocalizationSetContentPickerFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LocalizationSetContentPickerFieldDisplayDriver.cs @@ -52,6 +52,8 @@ public override IDisplayResult Edit(LocalizationSetContentPickerField field, Bui model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; model.SelectedItems = []; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/MultiTextFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/MultiTextFieldDisplayDriver.cs index 7b270243701..0cd77f3493c 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/MultiTextFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/MultiTextFieldDisplayDriver.cs @@ -49,6 +49,8 @@ public override IDisplayResult Edit(MultiTextField field, BuildFieldEditorContex model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/NumericFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/NumericFieldDisplayDriver.cs index cb9686908bf..0835ccd31b5 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/NumericFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/NumericFieldDisplayDriver.cs @@ -57,6 +57,9 @@ public override IDisplayResult Edit(NumericField field, BuildFieldEditorContext model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; + model.TypePartDefinition = context.TypePartDefinition; + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TextFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TextFieldDisplayDriver.cs index 4da381b3068..4020fa09c0e 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TextFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TextFieldDisplayDriver.cs @@ -40,6 +40,8 @@ public override IDisplayResult Edit(TextField field, BuildFieldEditorContext con model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TimeFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TimeFieldDisplayDriver.cs index 682f59b9ffd..09d78651863 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TimeFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TimeFieldDisplayDriver.cs @@ -39,6 +39,8 @@ public override IDisplayResult Edit(TimeField field, BuildFieldEditorContext con model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/UserPickerFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/UserPickerFieldDisplayDriver.cs index 54ea63e6839..dbe280253b2 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/UserPickerFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/UserPickerFieldDisplayDriver.cs @@ -50,6 +50,7 @@ public override IDisplayResult Edit(UserPickerField field, BuildFieldEditorConte model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.TypePartDefinition = context.TypePartDefinition; + model.IsNew = context.IsNew; if (field.UserIds.Length > 0) { diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/YoutubeFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/YoutubeFieldDisplayDriver.cs index 4ebca5464ae..9e3deaabf01 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/YoutubeFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/YoutubeFieldDisplayDriver.cs @@ -41,6 +41,8 @@ public override IDisplayResult Edit(YoutubeField field, BuildFieldEditorContext model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; + model.IsNew = context.IsNew; + model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditBooleanFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditBooleanFieldViewModel.cs index 3540c50ee55..2fd713616ac 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditBooleanFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditBooleanFieldViewModel.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Mvc.ModelBinding; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Metadata.Models; @@ -10,4 +11,8 @@ public class EditBooleanFieldViewModel public BooleanField Field { get; set; } public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditContentPickerFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditContentPickerFieldViewModel.cs index 5c3fa9f1782..8353da173f7 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditContentPickerFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditContentPickerFieldViewModel.cs @@ -11,7 +11,10 @@ public class EditContentPickerFieldViewModel public ContentPickerField Field { get; set; } public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } - + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } [BindNever] public IList SelectedItems { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateFieldViewModel.cs index 9d6b6518411..3a2ba9d4e4d 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateFieldViewModel.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Mvc.ModelBinding; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Metadata.Models; @@ -10,4 +11,8 @@ public class EditDateFieldViewModel public DateField Field { get; set; } public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateTimeFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateTimeFieldViewModel.cs index bd8a30bcfe3..3d8d2167472 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateTimeFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateTimeFieldViewModel.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Mvc.ModelBinding; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Metadata.Models; @@ -10,4 +11,8 @@ public class EditDateTimeFieldViewModel public DateTimeField Field { get; set; } public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditHtmlFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditHtmlFieldViewModel.cs index 23e4dfa2b75..3e17e7addcc 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditHtmlFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditHtmlFieldViewModel.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Mvc.ModelBinding; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Metadata.Models; @@ -10,4 +11,8 @@ public class EditHtmlFieldViewModel public HtmlField Field { get; set; } public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLinkFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLinkFieldViewModel.cs index 509a8d473db..5a8edc322c9 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLinkFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLinkFieldViewModel.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Mvc.ModelBinding; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Metadata.Models; @@ -12,4 +13,8 @@ public class EditLinkFieldViewModel public LinkField Field { get; set; } public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLocalizationSetContentPickerFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLocalizationSetContentPickerFieldViewModel.cs index b41eb653a78..6bfdfc49bc0 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLocalizationSetContentPickerFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLocalizationSetContentPickerFieldViewModel.cs @@ -14,4 +14,9 @@ public class EditLocalizationSetContentPickerFieldViewModel [BindNever] public IList SelectedItems { get; set; } + + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditMultiTextFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditMultiTextFieldViewModel.cs index 37a9c3bb951..a6887b1eb3c 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditMultiTextFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditMultiTextFieldViewModel.cs @@ -17,4 +17,8 @@ public class EditMultiTextFieldViewModel [BindNever] public ContentPartFieldDefinition PartFieldDefinition { get; set; } + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditNumericFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditNumericFieldViewModel.cs index 87c55cfbc67..2d22122faf5 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditNumericFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditNumericFieldViewModel.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Mvc.ModelBinding; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Metadata.Models; @@ -10,4 +11,8 @@ public class EditNumericFieldViewModel public NumericField Field { get; set; } public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTextFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTextFieldViewModel.cs index 5e303cc165b..bef880eedd2 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTextFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTextFieldViewModel.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Mvc.ModelBinding; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Metadata.Models; @@ -10,4 +11,8 @@ public class EditTextFieldViewModel public TextField Field { get; set; } public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTimeFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTimeFieldViewModel.cs index 5f70a589e64..8e2d65a4258 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTimeFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTimeFieldViewModel.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Mvc.ModelBinding; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Metadata.Models; @@ -10,4 +11,8 @@ public class EditTimeFieldViewModel public TimeField Field { get; set; } public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditUserPickerFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditUserPickerFieldViewModel.cs index ac7000241cd..e2fc72128fa 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditUserPickerFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditUserPickerFieldViewModel.cs @@ -23,6 +23,9 @@ public class EditUserPickerFieldViewModel [BindNever] public IList SelectedUsers { get; set; } = []; + + [BindNever] + public bool IsNew { get; set; } } public class VueMultiselectUserViewModel diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditYoutubeFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditYoutubeFieldViewModel.cs index 2deff7deb51..1174d42e29e 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditYoutubeFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditYoutubeFieldViewModel.cs @@ -1,4 +1,5 @@ using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Mvc.ModelBinding; using OrchardCore.ContentFields.Fields; using OrchardCore.ContentManagement; using OrchardCore.ContentManagement.Metadata.Models; @@ -14,4 +15,8 @@ public class EditYoutubeFieldViewModel public YoutubeField Field { get; set; } public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } + [BindNever] + public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] + public bool IsNew { get; set; } } From 1616ed245b155b1f5be4404255a606add52617ea Mon Sep 17 00:00:00 2001 From: brunoAltinet Date: Fri, 25 Oct 2024 10:33:59 +0200 Subject: [PATCH 2/2] fix: removed TypePartDefinition --- .../Drivers/BooleanFieldDisplayDriver.cs | 1 - .../Drivers/ContentPickerFieldDisplayDriver.cs | 1 - .../Drivers/DateFieldDisplayDriver.cs | 1 - .../Drivers/DateTimeFieldDisplayDriver.cs | 1 - .../Drivers/HtmlFieldDisplayDriver.cs | 1 - .../Drivers/LinkFieldDisplayDriver.cs | 1 - .../Drivers/LocalizationSetContentPickerFieldDisplayDriver.cs | 1 - .../Drivers/MultiTextFieldDisplayDriver.cs | 1 - .../Drivers/NumericFieldDisplayDriver.cs | 2 -- .../Drivers/TextFieldDisplayDriver.cs | 1 - .../Drivers/TimeFieldDisplayDriver.cs | 1 - .../Drivers/YoutubeFieldDisplayDriver.cs | 1 - .../ViewModels/EditBooleanFieldViewModel.cs | 2 -- .../ViewModels/EditContentPickerFieldViewModel.cs | 2 -- .../ViewModels/EditDateFieldViewModel.cs | 2 -- .../ViewModels/EditDateTimeFieldViewModel.cs | 2 -- .../ViewModels/EditHtmlFieldViewModel.cs | 2 -- .../ViewModels/EditLinkFieldViewModel.cs | 2 -- .../EditLocalizationSetContentPickerFieldViewModel.cs | 2 -- .../ViewModels/EditMultiTextFieldViewModel.cs | 3 +-- .../ViewModels/EditNumericFieldViewModel.cs | 2 -- .../ViewModels/EditTextFieldViewModel.cs | 2 -- .../ViewModels/EditTimeFieldViewModel.cs | 2 -- .../ViewModels/EditYoutubeFieldViewModel.cs | 2 -- 24 files changed, 1 insertion(+), 37 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/BooleanFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/BooleanFieldDisplayDriver.cs index eab63ee531b..9e9581a3fb1 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/BooleanFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/BooleanFieldDisplayDriver.cs @@ -32,7 +32,6 @@ public override IDisplayResult Edit(BooleanField field, BuildFieldEditorContext model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/ContentPickerFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/ContentPickerFieldDisplayDriver.cs index fc9e6ac7fde..01f239fd854 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/ContentPickerFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/ContentPickerFieldDisplayDriver.cs @@ -64,7 +64,6 @@ public override IDisplayResult Edit(ContentPickerField field, BuildFieldEditorCo model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; model.SelectedItems = []; var settings = context.PartFieldDefinition.GetSettings(); diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateFieldDisplayDriver.cs index 7758b262cbc..5bca0c4fc97 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateFieldDisplayDriver.cs @@ -40,7 +40,6 @@ public override IDisplayResult Edit(DateField field, BuildFieldEditorContext con model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateTimeFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateTimeFieldDisplayDriver.cs index 30e8f9d8252..81922dbf394 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateTimeFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/DateTimeFieldDisplayDriver.cs @@ -48,7 +48,6 @@ public override IDisplayResult Edit(DateTimeField field, BuildFieldEditorContext model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/HtmlFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/HtmlFieldDisplayDriver.cs index e819e351bc4..4165caf1ef8 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/HtmlFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/HtmlFieldDisplayDriver.cs @@ -76,7 +76,6 @@ public override IDisplayResult Edit(HtmlField field, BuildFieldEditorContext con model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LinkFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LinkFieldDisplayDriver.cs index e9597145dfb..fd70ce8c423 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LinkFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LinkFieldDisplayDriver.cs @@ -62,7 +62,6 @@ public override IDisplayResult Edit(LinkField field, BuildFieldEditorContext con model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LocalizationSetContentPickerFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LocalizationSetContentPickerFieldDisplayDriver.cs index 2bb7cd21a1f..7363368f2ad 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LocalizationSetContentPickerFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/LocalizationSetContentPickerFieldDisplayDriver.cs @@ -53,7 +53,6 @@ public override IDisplayResult Edit(LocalizationSetContentPickerField field, Bui model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; model.SelectedItems = []; diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/MultiTextFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/MultiTextFieldDisplayDriver.cs index 0cd77f3493c..ed270676ae8 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/MultiTextFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/MultiTextFieldDisplayDriver.cs @@ -50,7 +50,6 @@ public override IDisplayResult Edit(MultiTextField field, BuildFieldEditorContex model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/NumericFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/NumericFieldDisplayDriver.cs index 0835ccd31b5..2714d2a8b3b 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/NumericFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/NumericFieldDisplayDriver.cs @@ -57,9 +57,7 @@ public override IDisplayResult Edit(NumericField field, BuildFieldEditorContext model.Field = field; model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; - model.TypePartDefinition = context.TypePartDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TextFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TextFieldDisplayDriver.cs index 4020fa09c0e..885e86f6801 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TextFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TextFieldDisplayDriver.cs @@ -41,7 +41,6 @@ public override IDisplayResult Edit(TextField field, BuildFieldEditorContext con model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TimeFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TimeFieldDisplayDriver.cs index 09d78651863..85aceb0cc35 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TimeFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/TimeFieldDisplayDriver.cs @@ -40,7 +40,6 @@ public override IDisplayResult Edit(TimeField field, BuildFieldEditorContext con model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/YoutubeFieldDisplayDriver.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/YoutubeFieldDisplayDriver.cs index 9e3deaabf01..393c0881e69 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/YoutubeFieldDisplayDriver.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/Drivers/YoutubeFieldDisplayDriver.cs @@ -42,7 +42,6 @@ public override IDisplayResult Edit(YoutubeField field, BuildFieldEditorContext model.Part = context.ContentPart; model.PartFieldDefinition = context.PartFieldDefinition; model.IsNew = context.IsNew; - model.TypePartDefinition = context.TypePartDefinition; }); } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditBooleanFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditBooleanFieldViewModel.cs index 2fd713616ac..30f10ce3453 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditBooleanFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditBooleanFieldViewModel.cs @@ -12,7 +12,5 @@ public class EditBooleanFieldViewModel public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } - [BindNever] public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditContentPickerFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditContentPickerFieldViewModel.cs index 8353da173f7..bdccd5f007f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditContentPickerFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditContentPickerFieldViewModel.cs @@ -12,8 +12,6 @@ public class EditContentPickerFieldViewModel public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } - [BindNever] public bool IsNew { get; set; } [BindNever] public IList SelectedItems { get; set; } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateFieldViewModel.cs index 3a2ba9d4e4d..6e33bee9b8f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateFieldViewModel.cs @@ -12,7 +12,5 @@ public class EditDateFieldViewModel public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } - [BindNever] public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateTimeFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateTimeFieldViewModel.cs index 3d8d2167472..a1f56911e78 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateTimeFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditDateTimeFieldViewModel.cs @@ -12,7 +12,5 @@ public class EditDateTimeFieldViewModel public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } - [BindNever] public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditHtmlFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditHtmlFieldViewModel.cs index 3e17e7addcc..97dab37f05f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditHtmlFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditHtmlFieldViewModel.cs @@ -12,7 +12,5 @@ public class EditHtmlFieldViewModel public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } - [BindNever] public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLinkFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLinkFieldViewModel.cs index 5a8edc322c9..3eb92b83367 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLinkFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLinkFieldViewModel.cs @@ -14,7 +14,5 @@ public class EditLinkFieldViewModel public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } - [BindNever] public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLocalizationSetContentPickerFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLocalizationSetContentPickerFieldViewModel.cs index 6bfdfc49bc0..50f6d5b49ac 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLocalizationSetContentPickerFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditLocalizationSetContentPickerFieldViewModel.cs @@ -15,8 +15,6 @@ public class EditLocalizationSetContentPickerFieldViewModel [BindNever] public IList SelectedItems { get; set; } - [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } [BindNever] public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditMultiTextFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditMultiTextFieldViewModel.cs index a6887b1eb3c..7e5a12fa0da 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditMultiTextFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditMultiTextFieldViewModel.cs @@ -17,8 +17,7 @@ public class EditMultiTextFieldViewModel [BindNever] public ContentPartFieldDefinition PartFieldDefinition { get; set; } - [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } + [BindNever] public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditNumericFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditNumericFieldViewModel.cs index 2d22122faf5..b351fdc4001 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditNumericFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditNumericFieldViewModel.cs @@ -12,7 +12,5 @@ public class EditNumericFieldViewModel public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } - [BindNever] public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTextFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTextFieldViewModel.cs index bef880eedd2..b9e35101f1d 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTextFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTextFieldViewModel.cs @@ -12,7 +12,5 @@ public class EditTextFieldViewModel public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } - [BindNever] public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTimeFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTimeFieldViewModel.cs index 8e2d65a4258..9bc9f0b5e06 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTimeFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditTimeFieldViewModel.cs @@ -12,7 +12,5 @@ public class EditTimeFieldViewModel public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } - [BindNever] public bool IsNew { get; set; } } diff --git a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditYoutubeFieldViewModel.cs b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditYoutubeFieldViewModel.cs index 1174d42e29e..5acc81abc4c 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditYoutubeFieldViewModel.cs +++ b/src/OrchardCore.Modules/OrchardCore.ContentFields/ViewModels/EditYoutubeFieldViewModel.cs @@ -16,7 +16,5 @@ public class EditYoutubeFieldViewModel public ContentPart Part { get; set; } public ContentPartFieldDefinition PartFieldDefinition { get; set; } [BindNever] - public ContentTypePartDefinition TypePartDefinition { get; set; } - [BindNever] public bool IsNew { get; set; } }