U4-10980 - Creating Media-folder does not respect MediaType

Created by Lennard Fonteijn 16 Feb 2018, 15:50:10 Updated by Lennard Fonteijn 16 Feb 2018, 15:50:49

Duplicates: U4-10158

A customer found a very slippery bug.

We have a custom MediaType in the backoffice to enrich a piece of media with more information. For this specific type, we also made a container MediaType (which can also contain itself). So for example a "Documents"-container, which can contain other "Documents"-containers or instances of "Document".

We use a ContentPicker to pick there documents, and include them in Content-pages. Whenever you browse to this folder using the ContentPicker, you get the choice to inline create a folder (represented by the little + sign next to the current folder name). Whenever you use this method of adding a folder, Umbraco is literally hardwired to ALWAYS create a Folder-MediaType:

https://github.com/umbraco/Umbraco-CMS/blob/cf86409e3fec4198744189a48255543fc2f32614/src/Umbraco.Web/Editors/MediaController.cs#L607

Moving upwards from the problem, PostedFolder doesn't even accept a MediaType as input, which also means the API itself doesn't support it.

This is undesired behavior, the end-user should either get the choice to pick a MediaType it wants to use for the Folder, or the option shouldn't be there in the first place if "Folder" isn't allowed in the parent.

EDIT: I see now this issue has been lingering around for much longer: http://issues.umbraco.org/issue/U4-10158

Comments

Priority: Normal

Type: Bug

State: Duplicate

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.6.12

Due in version:

Sprint:

Story Points:

Cycle: