Skip to content

i18n: unable to save content #5122

@khawarizmus

Description

@khawarizmus

Describe the bug

The bug is inconsistent and I can't yet point out what the issue is but I keep getting an error when trying to save a translated version of a collection the save button is not responsive.

image

and I get a not very helpful error in the console:

image

To Reproduce

The following is my config.yml

site_url: https://SOMETHING.netlify.app/
logo_url: https://SOMETHING.netlify.app/logo.png

publish_mode: editorial_workflow
backend:
  name: git-gateway
  branch: master

media_folder: static/img
public_folder: /img

i18n:
  # Required and can be one of multiple_folders, multiple_files or single_file
  # multiple_folders - persists files in `<folder>/<locale>/<slug>.<extension>`
  # multiple_files - persists files in `<folder>/<slug>.<locale>.<extension>`
  # single_file - persists a single file in `<folder>/<slug>.<extension>`
  structure: multiple_folders

  # Required - a list of locales to show in the editor UI
  # en - English
  # ar - Arabic
  # ms - Malay
  # sw - Swahili
  locales: [en, ar, ms, sw]

  # Optional, defaults to the first item in locales.
  # The locale to be used for fields validation and as a baseline for the entry.
  default_locale: en

# Docs: https://www.netlifycms.org/docs/configuration-options/#collections
collections:
  - label: 'Site settings'
    name: 'site'
    files:
      - label: 'Info'
        name: 'info'
        file: 'content/site/info.json'
        format: 'json'
        editor:
          preview: false
        fields:
          - { label: Site Name, name: sitename, widget: string, hint: 'This is used for the site title' }
          - { label: Email Contact, name: contact, widget: string, hint: 'This email is used for the contact form' }
          - {
              label: Site Description,
              name: sitedescription,
              widget: string,
              hint: 'This is used as descriptive text for links that link to this site',
            }
          - {
              label: Site Language,
              name: sitelang,
              widget: string,
              pattern: ['^[a-z]{2}([-])?([A-Za-z]{2})?$', 'Must match "xx" or "xx-XX" syntax (ex. "en" or "sv-SE")'],
              hint: 'The default website language'
            }
          # - { label: Site Email, name: siteemail, widget: string, required: false }
  - name: 'blog'
    label: 'Blog'
    folder: 'content/blog'
    create: true
    i18n: true
    format: 'frontmatter'
    slug: '{{year}}-{{month}}-{{day}}-{{slug}}'
    # editor:
    #   preview: true
    fields:
      - { label: 'Title', name: 'title', widget: 'string', required: true, i18n: true }
      - { label: 'Description', name: 'description', widget: 'string', required: false, i18n: true }
      - { label: 'Body', name: 'body', widget: 'markdown', required: false }
  
  - name: 'campaigns'
    label: 'campaigns'
    label_singular: 'Campaign'
    folder: 'content/campaigns'
    create: true
    i18n: true
    format: 'frontmatter'
    slug: '{{slug}}'
    preview_path: 'campaigns/{{slug}}'
    fields:
      - {
          label: 'Campaign tag',
          name: 'tags',
          widget: 'list',
          default: ['zakat'],
          min: 1,
          max: 3
        }
      - { label: 'Title', name: 'title', widget: 'string', i18n: true, required: true }
      - { label: 'Description', name: 'description', widget: 'string', i18n: true, required: false }
      - { label: 'Cover Image', name: 'cover', widget: 'image', required: false, i18n: duplicate,  allow_multiple: false }
      - { label: 'Content', name: 'body', widget: 'markdown', i18n: true, required: true }
      - {
          label: 'Gallery',
          name: 'gallery',
          widget: 'list',
          required: false,
          summary: '{{fields.image}}',
          field: { label: 'Image', name: 'image', widget: 'image' },
        }

Expected behavior
the save button should save properly and there should be no errors

Applicable Versions:

  • Netlify CMS version: 2.10.99
  • Git provider: GitHub
  • OS: windows 10
  • Browser version: chrome 89.0.4389.82 (Official Build) (64-bit), firefox 86.0.1 (64-bit)
  • Node.JS version: 12

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions