decaporg / decaporg/decap-cms

Empty commit with i18n + nested collections (when missing a language file)

Open
#7,389 1 comment 0 reactions 1 assignee Claimed by @demshy View on GitHub
area: i18n area: nested-collections type: bug
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

In a nested collection that uses i18n, an entry is not saved if it's missing a language.

Consider the below structure for example. Note that posts is missing `_index.sl.md`.

```
content
│- _index.en.md
│- _index.sl.md

└──posts
│ │- _index.en.md
```

Corresponding config

```yaml
i18n:
structure: multiple_files
locales: [sl, en]

collections:
- name: content
label: Content
label_singular: post
folder: content
i18n: true
nested:
depth: 10
summary: "{{title}}"
fields:
- {name: title, widget: string, i18n: true}
```

If you try to save the posts/_index file via CMS, it will produce an empty commit. If you add `posts/_index.sl.md`, the commit will save changes as expected.

I stumbled upon this bug years ago and posted it on Netlify Forums, but the post is now deleted. Thanks to the Internet Archive, we have a snapshot version: https://web.archive.org/web/20221207001621/https://answers.netlify.com/t/changes-to-entries-saved-in-the-ui-but-commit-is-empty/34954

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.