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

Bug with adding custom media_folder. Directory not added to file location. #3483

Closed
jeremiahfallin opened this issue Mar 26, 2020 · 0 comments · Fixed by #3519
Closed

Bug with adding custom media_folder. Directory not added to file location. #3483

jeremiahfallin opened this issue Mar 26, 2020 · 0 comments · Fixed by #3519
Assignees

Comments

@jeremiahfallin
Copy link

Describe the bug
When using a file widget with a separate media folder, the correct directory pops up when choosing a file, but after selecting one the directory is not added to the path in the md file. Just the file name.

Tried adding it like this:

      - file: "src/pages/board/index.md"
        label: "Board Page"
        name: "board"
        media_folder: '/static/board'

and also to the widget itself:

{ label: File, name: file, media_folder: '/static/board', widget: file },

and neither of those seem to work.

To Reproduce

  1. Add a separate media folder to a file based page.
  2. Add a file widget.
  3. Try to add a file from the CMS to the web page.
  4. See that the directory is not added to the file's stored path.

Expected behavior
The path to the file should also be included like it is when you're not using a separate media folder.

Applicable Versions:

  • Netlify CMS version: 2.11.32
  • Git provider: GitHub

CMS configuration
I included the relevant info at the top.

Additional context
Related to feat #3208. Adding a public_folder field prepends the directory, like so:

      - file: "src/pages/board/index.md"
        label: "Board Page"
        name: "board"
        media_folder: '/static/board'
        public_folder: '/static/board'
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 a pull request may close this issue.

2 participants