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

Expose and manage system media types #16343

Merged
merged 2 commits into from
May 24, 2024
Merged

Conversation

kjac
Copy link
Contributor

@kjac kjac commented May 22, 2024

Prerequisites

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

Description

The core is depending on having certain media types available - the "system" media types (File, Folder, Image). Whilst not ideal, this is the current state of the core.

We need to ensure that these are not deleted or have their alias changed.

The V13 approach was purely client-side. This is enabled by this PR for V14 by adding IsDeletable and AliasCanBeChanged properties to the relevant media type endpoints.

Additionally, this PR ensures that we do not accept critical changes to the system media types at service level.

Testing this PR

The media type tree endpoints should list the system media types as non-deletable (IsDeletable == false).

The "by ID" endpoint should also list the system media types as non-deletable, and also non-alias-changeable 😆 (AliasCanBeChanged == false).

Copy link
Contributor

@Migaroez Migaroez left a comment

Choose a reason for hiding this comment

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

Works as described, code looks ok ✅
Todo: cleanup license file commit
Optional: add a unittest for the delete behaviour?

Copy link
Contributor

Choose a reason for hiding this comment

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

woopsie?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Geez. That explains why Git was complaining so much ... thanks 🤦 it's been removed.

@kjac
Copy link
Contributor Author

kjac commented May 23, 2024

There is a test for the delete behavior 😄 https://github.com/umbraco/Umbraco-CMS/pull/16343/files#diff-0603ca1f3e26b7b478be4d08bca0fae507da4ddadbb0f1f1c00e6e7859d37160R226-R235

Copy link
Contributor

@Migaroez Migaroez left a comment

Choose a reason for hiding this comment

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

After being blind on both ends, seems to be in a good state now 😄

@kjac kjac merged commit 07711aa into v14/dev May 24, 2024
15 checks passed
@kjac kjac deleted the v14/feature/system-media-types branch May 24, 2024 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants