New client response error "Required attribute: contentInLocales"

Hi there,

I built and maintain ringofkeys.org, which uses Dato and Auth0 to allow our members to edit their profiles, which are simple Dato entries. It’s worked very reliably for going on 3 years now across a Gatsby and now NextJS frontend, so first off thank you for building this platform!

Recently my users have been unable to edit profiles, and my Netlify function for updating their profile fields returns the following error response:

{
  message: "Required attribute: contentInLocales"
}

I haven’t been able to find any reference to a contentInLocales attribute anywhere in the documentation, so I’m unsure where or how to add this attribute to my payload. Is this is a per-field sort of localization attribute?

Here are my JS client versions:

  • @datocms/cma-client-browser”: “^1.1.12”
  • @datocms/cma-client-node”: “^1.1.12”

I also just retried after updating them to 2.0.0, but I didn’t expect it to change anything and it didn’t.

To make my updates to the profile entries, within the updateKey Netlify function (source code here, sorry I haven’t gotten to migrate it to TS yet), simply passing the new payload from their edited profile field into the client.item.update() function.

This has worked well for a long time, so I’m uncertain what could have changed? We have just one default locale, en, so I don’t know what localization constraint is being imposed here.

Hello @frank.ringofkeys ,

Now you can publish only select locales so the structure of the call has changed, with new required parameters: Publish a record - Record - Content Management API

However, the old way to do the calls should be compatible with this change, and should not error out.
Are you using the /cma-client-node 2.0.0 to do those calls? I’ll try and reproduce this issue and get back to you as soon as possible.

In the meantime, changing the call to reflect Publish a record - Record - Content Management API should work, sorry about this!

Thanks @m.finamor! I had been looking at the docs to update a record, and hadn’t traced the error thoroughly enough to determine that it’s only required when publishing, which I also do in that function. I’ll add that parameter and check again, then get back here.

No I started seeing the errors even as I continued to use ^1.1.12 of cma-client-node; I only tried bumping the version as a naive last attempt to get a different error. I may be missing something, but it does appear to be a backwards compatibility break.