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

use modifiable media path in file system composition #6096

Merged
merged 1 commit into from Aug 12, 2019

Conversation

ceee
Copy link
Contributor

@ceee ceee commented Aug 11, 2019

Problem

It was not possible to change the media path without using a custom composer like this:

public class CoreComposer : IUserComposer
{
  public void Compose(Composition composition)
  {
    composition.SetMediaFileSystem(() => new PhysicalFileSystem(SystemDirectories.Media));
  }
}

That's because the FileSystems composer uses a hard-coded folder ~/media for the PhysicalFileSystem and ignores the SystemDirectories.Media path which can be changed via the appSettings configuration.

composition.SetMediaFileSystem(() => new PhysicalFileSystem("~/media"));

Description

It's basically a one liner which replaces the mentioned hard-coded string with:

composition.SetMediaFileSystem(() => new PhysicalFileSystem(SystemDirectories.Media));

@nul800sebastiaan nul800sebastiaan merged commit fdcfc48 into umbraco:v8/dev Aug 12, 2019
@nul800sebastiaan
Copy link
Member

Ah good one @ceee - that should never have been hardcoded in the first place! 👍

Oh and woohoo! Congrats on your first accepted contribution to Umbraco CMS! 🎉

You've earned yourself that shiny new Contributor badge on Our Umbraco https://our.umbraco.com/members/id:113054/ 🎖

@nul800sebastiaan
Copy link
Member

Cherry picked for 8.1.3 600be98

@ceee ceee deleted the temp-fixcustomizablemediapath branch August 14, 2019 19:01
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.

None yet

3 participants