Skip to content

Conversation

@bjarnef
Copy link
Contributor

@bjarnef bjarnef commented Aug 14, 2024

Prerequisites

  • I have added steps to test this contribution in the description below

Description

This PR is a follow-up on #14833 which wasn't merged in old backoffice.

However I think it is still relevant to support folders (containers) for member type to streamline it with document type and media type. Furthermore member type also have some recently added features like copy of member type and composition.

@github-actions
Copy link

github-actions bot commented Aug 14, 2024

Hi there @bjarnef, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@georgebid
Copy link
Contributor

georgebid commented Aug 15, 2024

Hey @bjarnef, thanks for recreating this PR, I'll check back on the historic conversations around this one, and myself (or another core collaborator) will review this soon😸

@bjarnef
Copy link
Contributor Author

bjarnef commented Aug 26, 2024

@bergmania @elit0451 would this makes sense to support now to streamline content type features and as containers are supported for blueprints as well?
#15983

@nul800sebastiaan nul800sebastiaan changed the base branch from contrib to main May 5, 2025 12:24
@georgebid georgebid changed the base branch from main to v17/dev September 30, 2025 07:49
Copilot AI review requested due to automatic review settings September 30, 2025 08:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces container (folder) support for member types in the management API, aligning it with the existing folder functionality for document types and media types. This enhancement enables better organization of member types through hierarchical folder structures.

Key changes:

  • Implements member type container service with associated interfaces and locking mechanisms
  • Adds new UmbracoObjectType for member type containers with corresponding constants
  • Creates complete API controller structure for member type folder CRUD operations

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Umbraco.Core/Services/MemberTypeContainerService.cs Core service implementation for member type container operations
src/Umbraco.Core/Services/Locking/MemberTypeLocks.cs Locking configuration for member type operations
src/Umbraco.Core/Services/IMemberTypeContainerService.cs Interface definition for member type container service
src/Umbraco.Core/Models/UmbracoObjectTypes.cs Adds MemberTypeContainer enum value and reorganizes member-related types
src/Umbraco.Core/Constants-UdiEntityType.cs Adds member type container UDI entity type constant
src/Umbraco.Core/Constants-ObjectTypes.cs Adds member type container GUID constants
src/Umbraco.Cms.Api.Management/Controllers/MemberType/Folder/UpdateMemberTypeFolderController.cs API controller for updating member type folders
src/Umbraco.Cms.Api.Management/Controllers/MemberType/Folder/MemberTypeFolderControllerBase.cs Base controller for all member type folder operations
src/Umbraco.Cms.Api.Management/Controllers/MemberType/Folder/DeleteMemberTypeFolderController.cs API controller for deleting member type folders
src/Umbraco.Cms.Api.Management/Controllers/MemberType/Folder/CreateMemberTypeFolderController.cs API controller for creating member type folders
src/Umbraco.Cms.Api.Management/Controllers/MemberType/Folder/ByKeyMemberTypeFolderController.cs API controller for retrieving member type folders by key

georgebid and others added 3 commits September 30, 2025 13:08
Added a new service registration for `IMemberTypeContainerService`
in the `AddCoreServices` method of `UmbracoBuilder.cs`.
@bjarnef
Copy link
Contributor Author

bjarnef commented Oct 1, 2025

@nul800sebastiaan looks like the base method only has 5 arguments now? :)

MemberTypeContainerService has 7 arguments, max arguments = 5

@nul800sebastiaan
Copy link
Member

looks like the base method only has 5 arguments now? :)

It's just the code analyzer complaining that there are too many arguments. This is not something we can avoid, the base must take 7 arguments at this time. So all good.

@nul800sebastiaan
Copy link
Member

I've merged this now and marked it as a breaking change (a build will be needed, but that will definitely be needed once you upgrade to v17 anyway).
Now that the APIs are there, it doesn't mean the functionality is available in the backoffice interface.

However, this is now something that can be done programmatically and that means @ronaldbarendse Umbraco Deploy will need to support it and @KevinJump uSync will need to support it.

@nul800sebastiaan nul800sebastiaan merged commit f0cf470 into umbraco:v17/dev Oct 7, 2025
23 of 25 checks passed
@bjarnef bjarnef deleted the feature/management-member-type-container branch October 7, 2025 13:38
@ronaldbarendse
Copy link
Contributor

@nul800sebastiaan Did someone forget to review this PR before merging? 😅 Using the Management API to create a new folder instantly returns the following error:

POST /umbraco/management/api/v1/member-type/folder
{
  "name": "Test"
}

{
  "type": "Error",
  "title": "Not a contained object type. (Parameter 'containedObjectType')",
  "status": 500,
  "detail": "
   at Umbraco.Cms.Core.Models.EntityContainer..ctor(Guid containedObjectType)
   at Umbraco.Cms.Core.Services.EntityTypeContainerService`2.CreateAsync(Nullable`1 key, String name, Nullable`1 parentKey, Guid userKey)
   at Umbraco.Cms.Api.Management.Controllers.FolderManagementControllerBase`1.CreateFolderAsync[TCreatedActionController](CreateFolderRequestModel createFolderRequestModel, Expression`1 createdAction)
   at Umbraco.Cms.Api.Management.Controllers.MemberType.Folder.CreateMemberTypeFolderController.Create(CancellationToken cancellationToken, CreateFolderRequestModel createFolderRequestModel)
   ...",
  "instance": "ArgumentException"
}

Adding { Constants.ObjectTypes.MemberType, Constants.ObjectTypes.MemberTypeContainer } to the EntityContainer.ObjectTypeMap dictionary does fix this and the endpoint then returns a 201 with a newly created GUID.

However, because the IMemberTypeContainerRepository is a no-op implementation, the created item isn't stored anywhere, so there's not really anything Deploy (or uSync) can add support for...

I've partially fixed these issues in #20706, but the backoffice UI still needs to be implemented. If this isn't something we can ship in the final v17 release, I'd suggest reverting this PR and postponing it for v18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants