Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a field with no type using the content definition manager throws null exception. #14568

Closed
MikeAlhayek opened this issue Oct 23, 2023 · 0 comments · Fixed by #14569
Closed
Labels
Milestone

Comments

@MikeAlhayek
Copy link
Member

MikeAlhayek commented Oct 23, 2023

Describe the bug

When adding a field without specifiying the type of the field to the ContentDefinitionManager a null exception is thrown.

To Reproduce

Run the following migration


public class TestMigration : DataMigration
{
    private readonly IContentDefinitionManager _contentDefinitionManager;

    public TestMigration(IContentDefinitionManager contentDefinitionManager)
        => _contentDefinitionManager = contentDefinitionManager;
    

    public int Create()
    {
        _contentDefinitionManager.AlterPartDefinition("UserStoryInfoPart", part => part
            .WithDisplayName("User Story Info Part")
            .WithField("Description", part => part
                //.OfType("TextField") // without defining the type, we get a null exception.
                .WithEditor("TextArea")
            )
        );

        return 1;
    }
}

Expected behavior

Maybe an exception that is more description instead of a null exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant