Closed ronaldbarendse closed 4 years ago
This will need additional changes to be correctly fixed, as we discovered another situation where the default Textbox
data type (with ID -88) was mistakenly deleted (on an empty instance) and later re-added (getting a new ID). Although some data types can't be deleted (from the back-office), but Textbox
isn't included:
Besides EnsureMemberProperties
, there's a method to get the default member property types that contains a different ID for the PasswordQuestion
(LabelString
instead of Textbox
):
IMHO these IDs should only be used to create the default data types on install (in the DatabaseDataCreator
) and we should never assume these IDs always exist (especially when deleting them from the back-office is possible). If this isn't possible, we might also consider making all negative system IDs non-removable...
After removing the default 'Date Picker with time' data type, Models Builder fails to build the Member model with this error:
I can verify on a new install that this data type isn't used on the default member type:
Umbraco version
I am seeing this issue on Umbraco 8.6.0 and Models Builder 8.1.0.
Reproduction
Bug summary
Looking at the stack trace, the issue comes from Umbraco (not Models Builder). specifically the
EnsureMemberProperties
method that contains the wrong data types: https://github.com/umbraco/Umbraco-CMS/blob/280f4e7cbef8a1c11b8ef92db8e923d0a3ef8903/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs#L88-L115Steps to reproduce
Expected result
The
EnsureMemberProperties
method should not throw the exception, as the property is present and the value type correct (DateTime
, although not from theUmbraco.Textbox
editor, butUmbraco.Label
).As the 'Label (datetime)' can't be removed from the backoffice, it's practically always available and ensuring on that data type should not throw exceptions.