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

File widget ignores its own media_folder and instead uses media_folder from the root #7333

Open
cshaa opened this issue Nov 27, 2024 · 0 comments
Labels
area: media-library type: bug code to address defects in shipped code

Comments

@cshaa
Copy link
Contributor

cshaa commented Nov 27, 2024

Describe the bug
My team is working on a static web page that has a lot of images that are preprocessed by Vite. That's why we have media_folder: "src/assets/uploads" in the root of the config (that's where images are supposed to go). Now, we want to add the option to upload files, which should be placed directly in the public folder, so we used the media_library.media_folder property on the file widget – but it is ignored, and the files are uploaded to src/assets/uploads instead of public/uploads.

To Reproduce

  1. Create the following config.yml:
local_backend: false
backend:
  name: gitlab
  repo: ...
  branch: main
  auth_type: pkce
  api_root: https://gitlab.druit.org/api/v4
  base_url: https://gitlab.druit.org
  auth_endpoint: oauth/authorize
  app_id: ...
locale: cs
publish_mode: simple
media_folder: src/assets/uploads
public_folder: "#uploads"
collections:
  - ...
  - name: files
    label: Files
    folder: src/content/files
    create: true
    fields:
      - widget: file
        name: file
        media_library:
          allow_multiple: false
          media_folder: public/uploads
  1. Go to administration > Files and uplad a file
  2. See that it was uploaded to src/assets/uploads and not public/uploads

Applicable Versions:

  • Decap CMS version: 3.4.0
  • Git provider: GitLab
  • Node.JS version: 23.3
@cshaa cshaa added the type: bug code to address defects in shipped code label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: media-library type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants