Content types and property definitions breaking changes
Breaking changes to content types, property definitions, tab definitions, block types, and Dynamic Properties in CMS 13.
This article covers content type, property definition, tab definition, block type, and Dynamic Properties breaking changes in CMS 13.
Name validation rules
CMS 13 enforces stricter naming rules across content types, property definitions, property definition types, and tab definitions. These rules are applied during database migration and at runtime.
Rules for all definition names
- Length: Names must be between 2 and 255 characters.
- Format: Names must follow the regex pattern
^[A-Za-z][_0-9A-Za-z]+— they must start with a letter and contain only letters, digits, and underscores. - Spaces and special characters are not allowed in programmatic names. Use
[Display(Name = "...")]attributes to set human-readable display names.
Automatic migration
Existing definitions with invalid names are migrated automatically when upgrading to CMS 13:
| Definition Type | Single-character prefix | Invalid character replacement |
|---|---|---|
Content types (ContentType.Name) | CT_ prefix added | Invalid characters replaced with _ |
Property definitions (PropertyDefinition.Name) | PD_ prefix added | Invalid characters replaced with _ |
Property definition types (PropertyDefinitionType.Name) | PDT_ prefix added | Invalid characters replaced with _ |
Tab definitions (TabDefinition.Name) | G_ prefix added | Invalid characters replaced with _ |
Tab definition impact
Tab names that previously contained spaces or special characters (for example, "List Definition", "Meta Data / SEO", "Error Pages") must be updated to valid names (for example, "ListDefinition", "MetaData", "ErrorPages"). Use the [Display(Name = "...")] attribute to preserve the human-readable display name in the UI.
EPiServer.DataAbstraction.ContentType
-
Property
DefaultWebFormTemplatewas removed because WebForms is not supported. -
LocalizationServiceservice properties were removed as localized labels are retrieved directly from theLocalizationService.
EPiServer.DataAbstraction.IContentTypeRepository
The IContentTypeRepository interface has significant behavior changes in CMS 13:
- The generic
IContentTypeRepository<>implementation was removed. Use the non-genericIContentTypeRepositoryinstead. - The interface now implements methods previously inherited from
EPiServer.DataAbstraction.IContentTypeRepository<>. - The interface includes the
Save(IEnumerable<ContentType>, ContentTypeSaveOptions)method previously specified onEPiServer.DataAbstraction.ContentTypeRepository. - The
Save(ContentType)method also saves thePropertyDefinitionson theContentType. Load(string name)is now case-insensitive.- Default behavior for method
Savehas changed so properties not present incontentType.PropertyDefinitionsare deleted. Previously, they were deleted only if no data was persisted. UseContentTypeSaveOptions.KeepUndefinedPropertyDefinitionsto keep properties not present in the definition. - Changes only in casing on properties (
Name,EditCaption,HelpText,DefaultValue, andEditorHint) are no longer ignored when saving. - Changing
Requiredfor a property definition is now considered aMajorsemantic change (previously it wasMinor). - Saving a content type with an empty
ACLno longer resets it to its default value. Saving withACLset tonullstill resets to the default. - Saving a content type with an
ACLcontaining an entry with a different access level thanCreatenow throws aValidationException. - The
Savemethod validates content type access requirements when creating a content item unlessAccessLevel.NoAccessis passed in. - The
Listmethod now first sorts onSortOrderand then onNamefor ContentTypes that have same value onSortOrder. Previously the sorting was not deterministic for ContentTypes with sameSortOrder.
EPiServer.DataAbstraction.ContentTypeRepository
This base class is obsolete and is no longer implemented by the default implementation.
EPiServer.DataAbstraction.ContentTypeModelRepository
The class is obsolete, to be replaced by the EPiServer.DataAbstraction.RuntimeModel.IContentTypeModelRepository service. The default constructor was replaced by one taking dependencies.
EPiServer.DataAbstraction.IPropertyDefinitionRepository
- Methods
SaveandDeletewere made obsolete with a compilation error. To add, update, or remove aPropertyDefinitionfrom aContentType, load theContentTypeand add, update, or remove entries in the propertyPropertyDefinitions. CheckUsage()–isDynamicparameter was removed. Dynamic Properties are no longer supported.GetUsage()–isDynamicparameter was removed. Dynamic Properties are no longer supported.ListDynamic()– Method was removed. Dynamic Properties are no longer supported.Save– A new argument was added to indicate whether the cache should be cleared.- Throws
ValidationExceptioninstead ofDataAbstractionExceptionwhen thePropertyDefinition.Nameis invalid. - Throws
ValidationExceptioninstead ofNotSupportedExceptionwhen a block property is set asRequiredorLanguageSpecific. - Throws
ValidationExceptioninstead ofDataAbstractionExceptionwhen a block used in a list property contains a category property.
- Throws
EPiServer.DataAbstraction.PropertyDefinitionRepository
- The
PropertyDefinitionRepositoryis obsolete and is no longer used in the CMS. UseIPropertyDefinitionRepositoryinstead. - The
PropertyDefinitionSavedevent no longer raises when aTaborPropertyDefinitionTypeis updated.
EPiServer.DataAbstraction.PropertyDefinition
- Property
Searchableis obsolete in favor of propertyIndexingType. - Property
IsDynamicPropertywas removed. Dynamic Properties are no longer supported. - Property
LocalizationServicewas obsoleted.
EPiServer.DataAbstraction.PropertyDefinitionFields
Searchablewas removed in favor ofIndexingType.
EPiServer.DataAbstraction.PropertyDefinitionType
LocalizationServiceandContentTypeRepositoryservice properties were removed as localized labels are retrieved directly from theLocalizationService.
EPiServer.DataAbstraction.IPropertyDefinitionTypeRepository
- Method
SavethrowsValidationExceptioninstead ofArgumentExceptionwhen thePropertyDefinitionType.Nameis invalid. - Events
PropertyDefinitionTypeDeleted,PropertyDefinitionTypeSaving, andPropertyDefinitionTypeSavedonInternal.PropertyDefinitionTypeRepositorywere removed in favor of events on theIPropertyDefinitionTypeEventsinterface.
EPiServer.DataAbstraction.IBackingTypeResolver
- The return type of the
Resolvemethod changed fromTypetoPropertyDefinitionTypeResolution. The .NET backing type can be accessed from thePropertyDefinitionType.DefinitionTypeinstead.
Block type changes
-
EPiServer.DataAbstraction.BlockPropertyDefinitionType– CMS 13 no longer creates differentPropertyDefinitionTypeinstances per block type. Instead, there is a commonPropertyDefinitionType(withDataTypeasBlock) for all block types. The specific block type is defined onPropertyDefinition.ItemTypeReferencefor a block property. -
EPiServer.DataAbstraction.BlockTypeRepository– Removed in favor ofEPiServer.DataAbstraction.IContentTypeRepository. -
EPiServer.DataAbstraction.PageTypeRepository– Removed in favor ofEPiServer.DataAbstraction.IContentTypeRepository. -
EPiServer.DataAbstraction.PageType– PropertiesFileName,FileNameForSite, andExportableFileNamewere removed (historical WebForms support).fileNamewas removed from the constructor.
Searchable attribute changes
-
EPiServer.DataAnnotations.SearchableAttribute– Type now inheritsEPiServer.DataAnnotations.IndexingTypeAttribute. The constructor that accepted a bool argument is obsolete. Use IndexingTypeAttribute instead. The propertyIsSearchableis made obsolete in favor ofIndexingType. -
EPiServer.DataAbstraction.RuntimeModel.PropertyDefinitionModel–Searchablewas removed in favor ofIndexingType.
EPiServer.DataAbstraction.TabDefinition
- Constructor with
LocalizationServiceargument was removed. Use other constructor.
EPiServer.DataAbstraction.ITabDefinitionRepository
- Method
SavethrowsValidationExceptioninstead ofDataAbstractionExceptionwhen theTabDefinition.Nameis empty.
Runtime model changes
-
EPiServer.DataAbstraction.RuntimeModel.ContentDataInterceptor– Made internal. -
EPiServer.DataAbstraction.RuntimeModel.ContentDataInterceptorHandler– Made internal. If you need to register a custom accessor for property data, useEPiServer.DataAbstraction.RuntimeModel.IPropertyDataInterceptorRegistratorinstead. -
EPiServer.DataAbstraction.RuntimeModel.IAvailableModelSettingsRepository– New methodGetRuntimeSetting(ContentType contentType)was added. -
EPiServer.DataAbstraction.RuntimeModel.IContentTypeModelRepository– New methodGetContentTypeModel(ContentType contentType)was added.
Dynamic Properties removal
Dynamic Properties are fully removed in CMS 13. The following classes, interfaces, and members have been deleted:
EPiServer.DataAbstraction.DynamicPropertyEPiServer.DataAbstraction.DynamicPropertyCollectionEPiServer.DataAbstraction.DynamicPropertyStatusEPiServer.Core.DynamicPropertyBagEPiServer.Core.DynamicPropertyCacheEPiServer.Core.DynamicPropertyLookupEPiServer.Core.DynamicPropertyPageEPiServer.Core.IDynamicPropertyLookupEPiServer.Core.ContentOptions.EnableDynamicProperties– Now throwsNotSupportedException.EPiServer.DataAbstraction.PropertyDefinition.IsDynamicProperty– Removed.EPiServer.DataAbstraction.PropertyGetHandler.PropertyHandlerWithDynamicProperties()– Removed.
The associated stored procedures and database tables have also been removed.
Other data abstraction changes
-
EPiServer.DataAbstraction.Activities.Activity– PropertyRawDatawas removed in favor of propertyExtendedData. -
EPiServer.DataAbstraction.Activities.ContentActivityFeed– TheInstanceproperty is obsolete. Retrieve the singleton instance from the service container. -
EPiServer.DataAbstraction.ContentCoreData– Removed in favor ofEPiServer.DataAbstraction.ContentNode. TheContentNodeclass provides similar functionality with improved naming and additional tracking properties. -
EPiServer.DataAbstraction.IContentCoreDataLoader– Removed in favor ofEPiServer.DataAbstraction.IContentNodeLoader. -
EPiServer.DataAbstraction.ConflictingResourceException– Constructor that acceptsmessageandinner exceptionhas replaced another constructor. -
EPiServer.DataAbstraction.ILanguageBranchRepository– MethodSavenow throwsConflictingResourceExceptioninstead ofDataAbstractionExceptionwhen theLanguageBranch.LanguageIDalready exists, and instead ofEPiServerExceptionwhen theLanguageBranch.URLSegmentis already in use. -
EPiServer.DataAbstraction.Category–LocalizationServiceservice properties were removed. -
EPiServer.DataAbstraction.Frame–LocalizationServiceservice properties were removed. -
EPiServer.DataAbstraction.SoftLink– PropertyLinkStatuswas removed. Use propertyHttpStatusCodeinstead. -
EPiServer.DataAbstraction.IContentSoftLinkRepository– New methodLoadwas added. -
EPiServer.DataAbstraction.ContentCoreData– PropertyExternalFolderIDwas removed because it is no longer used.
Updated 9 days ago
