Skip to content

collection with path in Gitea returns error 400 for DRAFT_MEDIA_FILES #7281

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

Closed
bbaulenas opened this issue Sep 17, 2024 · 5 comments · May be fixed by #7432
Closed

collection with path in Gitea returns error 400 for DRAFT_MEDIA_FILES #7281

bbaulenas opened this issue Sep 17, 2024 · 5 comments · May be fixed by #7432
Labels
area: extensions/backends/gitea type: bug code to address defects in shipped code

Comments

@bbaulenas
Copy link

bbaulenas commented Sep 17, 2024

Hi! I'm facing an error, it's my first time using Decap.

Describe the bug
I've created a collection with a specific path, when i try to create a new object in the admin it keeps loading with an error in console:
GET https://mygitea.com/api/v1/repos/myname/myrepo/git/trees/blog:blog%2Fcontent%2Fblog%2FDRAFT_MEDIA_FILES 400 (Bad Request)

If I remove the collection "path" and media folders, all works as expected.

To Reproduce
Create a collection with this config in a Gitea backend

backend:
  name: gitea
  repo: my-user/my-repo
  app_id: my-app-id
  api_root: https://mygitea.com/api/v1
  base_url: https://mygitea.com
  auth_endpoint: https://mygitea.com/login/oauth/authorize
  branch: blog

site_url: http://localhost
display_url: https://your-site.com

media_folder: "blog/static/uploads"
public_folder: "static/uploads" # la ruta d'imatges que posa decap

collections:
  - name: "blog"
    label: "Blog"
    folder: "blog/content/blog"
    path: '{{year}}/{{month}}/{{slug}}/content'
    media_folder: ''
    public_folder: ''
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    fields: 
      - { label: "Layout", name: "layout", widget: "hidden", default: "blog" }
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Publish Date", name: "date", widget: "datetime" }
      - { label: "Featured Image", name: "thumbnail", widget: "image" }
      - { label: "Rating (scale of 1-5)", name: "rating", widget: "number" }
      - { label: "Body", name: "body", widget: "markdown" }

Expected behavior
Allow me to create a collection object and store images in "{{year}}/{{month}}/{{slug}}/content"

Applicable Versions:

  • decap-cms-app 3.3.3
  • decap-cms-core 3.4.2
  • decap-cms 3.3.3
  • Git provider: Gitea
@bbaulenas bbaulenas added the type: bug code to address defects in shipped code label Sep 17, 2024
@charludo
Copy link

Same here

@bitgroestl
Copy link

bitgroestl commented Mar 20, 2025

Same problem here.

The string "DRAFT_MEDIA_FILES" is only used here (nowhere else in this repository), so this could be a starting point for troubleshooting.

Here is a screenshot from my browser console. Looks like a stacktrace, might be useful:
Image

@bitgroestl
Copy link

@bbaulenas @charludo could you please check if #7432 fixes this issue for you?

@charludo
Copy link

@bbaulenas @charludo could you please check if #7432 fixes this issue for you?

Sorry for the late reply - yes, it does! 🎉 Thank you so much for the fix!

@bitgroestl
Copy link

No Problem. I'm glad it works for you, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: extensions/backends/gitea type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants