decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.98k stars 3.05k forks source link

i18n content with multiple_folders is broken in DecapCMS 3.0.0 #6913

Closed Billybobbonnet closed 1 year ago

Billybobbonnet commented 1 year ago

While it works properly with the versions prior to 3.0.0, it fails to display content after 3.0.0

Here is my config.yml

backend:
  name: github
  repo: XXX/seed
  branch: main
  base_url: https://XXXXXXXXi.execute-api.eu-west-2.amazonaws.com/
  auth_endpoint: "/dev/auth"
  cms_label_prefix: "XXX/"
publish_mode: editorial_workflow
media_folder: "public"
public_folder: "/"
site_url: https://XXX.fr
logo_url: /icon.png
show_preview_links: false
slug:
  encoding: "ascii"
  clean_accents: true
  sanitize_replacement: "-"
i18n:
  structure: multiple_folders
  locales: [en, fr]
  default_locale: en
collections:
  - name: "editorial" 
    label: "Editorial content" # Used in the UI
    i18n: true
    slug: "{{id}}"
    folder: "content/pages" # The path to the folder where the documents are stored
    create: true # Allow users to create new documents in this collection
    fields: 
      - { label: id, name: id, widget: string, i18n: duplicate }
      - { label: Body, name: body, widget: markdown, i18n: true }

These are very simple documents. Everything works when I simply change the script to import from https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js to https://unpkg.com/netlify-cms@^2.10.17/dist/netlify-cms.js

Billybobbonnet commented 1 year ago

Note that it fails to load the list of the i18n collection items, but if I target the URL of an item, it loads the page properly. I investigated if it was related to the slug not being "title" but it didn't help.

juniyadi-pintar commented 1 year ago

Thanks @Billybobbonnet

I have the same issue when using multiple_folders, content does not load and shows "No Entries"

But after switch to https://unpkg.com/netlify-cms@^2.10.17/dist/netlify-cms.js , it's working fine

The error coming when using: https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js Admin Config

i18n:
  structure: multiple_folders
  locales: [en, id]
  default_locale: en

collections:
- name: blog
  label: "blog"
  folder: "contents/blog"
  identifier_field: title
  extension: md
  widget: "list"
  create: true
  i18n: true
  slug: "{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
  fields:
    - name: title
      label: Title
      widget: string
      i18n: true
    - name: body
      label: Body
      widget: markdown
      i18n: true
    - label: "Tags"
      name: "tags"
      widget: "list"
      i18n: true
    - label: "Authors"
      name: "authors" 
      i18n: true
      widget: "select"
      options: ["juniyadi", "yusran"]
Screenshot 2023-10-05 at 09 24 33 Screenshot 2023-10-05 at 09 28 39
demshy commented 1 year ago

Hey guys, thanks for your patience and great issue details. This should be fixed in 3.0.9, would you mind trying it out?

juniyadi-pintar commented 1 year ago

Hi @demshy , i can confirm. this is working now using 3.0.9 Thanks

Screenshot 2023-10-12 at 10 48 04
Billybobbonnet commented 1 year ago

For what it's worth, I also confirm the issue is fixed. Keep up the good work guys :-)