Skip to content

Image uploaded to a branch does not load in decap #7662

@tpluscode

Description

@tpluscode

Describe the bug

I added a feature in a website that we build where users will be able to submit entries to a certain collection by using a form available (semi-)publicly. Images uploaded using that form will be saved to the PR that I create in the backend.

Here an example of such a PR.

You can see the rendered result. We use nuxt.

However, decap tries to load the image from the main branch when opening this for editing

Expected behavior

Images added to a draft should be loaded from the matching branch in decap.

Screenshots

Image

Applicable Versions:

  • Decap CMS version: decap-cms-app 3.8.4 decap-cms-core 3.9.0
  • Git provider: GitHub

CMS configuration

I removed all but the collection in question

backend:
  name: github
  repo: opendata-swiss/metadata.swiss
  squash_merges: true

publish_mode: editorial_workflow

media_folder: "public/img/uploads"
public_folder: "/img/uploads"

i18n:
  structure: multiple_files
  default_locale: de
  locales: [de, fr, it, en]

collections:
  - name: Showcases
    label: "Showcases"
    label_singular: Showcase
    folder: "opendata.swiss/ui/content/showcases"
    i18n: true
    extension: md
    widget: "list"
    create: true
    fields:
      - label: Active
        name: active
        widget: boolean
        default: true
        i18n: duplicate
      - label: Title
        name: title
        widget: string
        i18n: true
      - label: Image
        name: image
        widget: image
        i18n: duplicate
      - label: Website
        name: url
        widget: string
        i18n: duplicate
        required: false
      - label: Category
        name: categories
        widget: piveau-vocabulary
        multiple: true
        i18n: duplicate
        piveau:
          search: https://piveau-hub-search-ln.zazukoians.org/
          vocabulary: data-theme
      - label: Type of content
        name: type
        widget: select
        i18n: duplicate
        options:
          - label: "Application"
            value: application
          - label: "Data Visualization"
            value: data_visualization
          - label: "Event"
            value: event
          - label: "Blog/Article"
            value: blog_and_media_articles
      - name: datasets
        label: Datasets
        widget: piveau-dataset
        multiple: true
        i18n: duplicate
        required: false
        piveau:
          search: https://piveau-hub-search-ln.zazukoians.org/
      - name: tags
        label: Tags
        widget: list
      - name: body
        label: Body
        widget: markdown
        i18n: true

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugcode to address defects in shipped code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions