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

required ignored in fields inside a list on i18n translations #5653

Open
paurakhsharma opened this issue Jul 28, 2021 · 0 comments
Open

required ignored in fields inside a list on i18n translations #5653

paurakhsharma opened this issue Jul 28, 2021 · 0 comments
Labels
area: extensions/widgets/list area: i18n type: bug code to address defects in shipped code

Comments

@paurakhsharma
Copy link

Describe the bug
required on fields inside a list field is ignored for i18n transitions.
required is only respected in the first translation but is not respected for other translations.

To Reproduce

  1. Clone the repo
git clone https://github.com/surjithctly/neat-starter.git
  1. Use the config given below

  2. Start local netlify proxy

npx netlify-cms-proxy-server
  1. Start local dev server
npm run start
  1. Go to http://localhost:8080/admin

  2. Click on media channels

  3. Click on Add distribution on Writing in ES

  4. Publish while channel is empty

Expected behavior
Expected to see error message Channel field is required

Actual Behaviour
Was able to save with empty field

Screenshots
image

Applicable Versions:

  • netlify-cms-app 2.15.30
  • netlify-cms-core 2.46.0
  • index.js:27 netlify-cms 2.10.150
  • Browser version Chrome 92 on MacOS Big Sur 11.4
  • Node.JS version: v16.1.0

CMS configuration

i18n:
  structure: single_file
  locales: [en, es, ar, hi, zh]
  default_locale: en

backend:
  # Use netlify identity as backend
  name: git-gateway
  branch: master
  ### enable below lines for github integration ###
  # name: github
  # repo: surjithctly/neat-starter
media_folder: "src/static/img"
public_folder: "/static/img"

# Please run "npx netlify-cms-proxy-server" for local backend
local_backend: true
# publish_mode: editorial_workflow
collections:
  [
    {
      label: "Repeated Content Blocks",
      name: "generalAreas",
      i18n: true,
      files:
        [
          {
            name: "media",
            label: "Media Channels",
            file: "src/_data/channels.json",
            i18n: true,
            fields:
              [
                {
                  label: "Distribution",
                  name: "distribution",
                  widget: "list",
                  required: true,
                  allow_add: true,
                  i18n: true,
                  fields:
                    [
                      {
                        name: "channel",
                        label: "Channel",
                        widget: "string",
                        i18n: true,
                        required: true,
                      },
                    ],
                },
              ],
          },

        ],
    },
  ]

@paurakhsharma paurakhsharma added the type: bug code to address defects in shipped code label Jul 28, 2021
@paurakhsharma paurakhsharma changed the title required ignored on i18n translations required ignored in fields inside a list on i18n translations Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: extensions/widgets/list area: i18n type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants