Changes to entries saved in the UI, but commit is empty

Hi,

I have a weird bug and I didn’t find anything similar on the forums.

Changes to existing entries are saved in the UI, but the commit is empty - 0 lines are committed. So when I refresh, the changes are gone.

This only happens on Netlify, with npx netlify-cms-proxy-server it saves the file as expected.

I can save a new entry, but then I can’t change it.

This happens to nested collections only.

Did anyone have a similar problem?

Netlify Site ID: caa3b952-afd6-4aba-94ab-f3b59e80fc22

Config.yml (abbrevated)

local_backend: true
site_url: example.com
logo_url: /media/images/izi-logo.svg
media_folder: "static/images"
public_folder: "/images"

backend:
  name: git-gateway
  branch: master
  squash_merges: true

i18n:
  structure: multiple_files
  locales: [sl, en, hr]

slug:
  encoding: "ascii"
  clean_accents: true

aliases:
  - &TITLE {label: Title, name: "title", widget: "string", i18n: true}
  - &DRAFT {name: "draft", hint: "if enabled, page will not be visible", widget: "boolean", i18n: true, required: false}
  - &WEIGHT {label: Weight, name: "weight", widget: "number", required: false, i18n: duplicate}
  - &TITLE_STYLED {label: "Title with HTML style", name: "titleStyled", widget: "string", required: false, i18n: true}
  - &DESCRIPTION {name: "description", widget: "text", i18n: true}
  - &CONTENT {label: "Content", name: "body", widget: "markdown", i18n: true}
  - &DATE {label: Date, name: "date", hint: "Post creation date", widget: "date", i18n: duplicate}
  - &PUBLISH_DATE {label: "Publish Date", hint: "If set, the post will be published on this date", name: "publishdate", widget: "date", i18n: duplicate, required: false, default: ''}
  - &EXPIRY_DATE {label: "Expiry Date", hint: "If set, the post will be unpublished on this date", name: "expirydate", widget: "date", i18n: duplicate, required: false, default: ''}
  - &VISIBLE_IN_ADMIN {name: "visibleInAdmin", widget: "hidden", default: true, i18n: duplicate}

  - &SORT_FIELDS ['title', 'weight', 'date']

collections:
  - name: "services"
    label: "services"
    i18n: true
    label_singular: "service"
    folder: "content/services"
    create: true
    preview_path_date_field: "date"
    slug: "{{slug}}"
    path: "{{slug}}/index"
    preview_path: "/services/{{slug}}"
    filter: {field: "visibleInAdmin", value: true}
    sortable_fields: *SORT_FIELDS
    editor:
      preview: false
    nested:
      depth: 10
      summary: "{{title}}"
    meta: {path: {widget: string, label: 'Path', index_file: 'index'}}
    fields:
      - {name: url, widget: string, i18n: true, required: false}
      - *TITLE
      - *DRAFT
      - *WEIGHT
      - *TITLE_STYLED
      - *DESCRIPTION
      - *CONTENT
      - *DATE
      - *PUBLISH_DATE
      - *EXPIRY_DATE
      - *VISIBLE_IN_ADMIN

hi there, sorry to be slow to reply. is this still occurring? are you referring to content changes or configuration changes?

if you are storing your content in a headless CMS such as contentful etc i would expect the commit to not change. Can you maybe explain a little bit more what you are seeing?

My best bet is that there’s something off with this bit

path: "{{slug}}/index"

How about specifying the extension?

 path: "{{slug}}/index.md"

More info here: Beta Features! | Netlify CMS | Open-Source Content Management System

Thank you both for your input.

@perry I am referring to content changes. When a user saves changes, there is a commit, but it’s empty, so no changes are saved. Content is git-based and my SSG is Hugo.

@tomrutgers I tried that, but no success. In the docs example, it’s also without extension and I believe this wouldn’t work locally if this was the case.

I inspected the console and network tab in dev tools and I didn’t find anything suspicious. No errors, everything is saved the same way as on the working collection.

I tried to upload a new image and add it to the markdown field - nothing was committed.

I have no more ideas on how to debug from here. I am happy to provide additional info.

Maybe the slug property overwrites the index? Have you tried using your config without it?

@erez Do you have any ideas?

Thanks for the mention @tomrutgers

@martinjagodic, nested collections gives you full control over the file path/slug so I suggest removing slug: "{{slug}}" and path: "{{slug}}/index" from the configuration completely just in case there’s some conflict there.

Also see I18n + nested collections doesn't show the entire collection · Issue #4677 · netlify/netlify-cms · GitHub for i18n support with nested collections (TLDR: it’s not supported yet)

Hi, @erez thanks for your answer.

I removed slug and path but with no success. It’s strange because I know it’s not supported, but I’ve used i18n + nested collections before and it worked fine.

Do you have any idea when they will officially work together?

Hi @martinjagodic, we don’t have a timeline for it yet.

We’re open to someone contributing into trying to make them work together, but I believe it would be at least a medium size effort,