Sync CLI: Singleton sync fails if a field is named "title"

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [x] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

Using sync out / sync in in another app.
I have a field named “title” in a singleton schema, and I get an error when syncing in:
“failed: Validation error: title.pt: Not a known invariant value., title.fr: Not a known invariant value., title.en: Not a known invariant value.”
Renaming the field to another name solves the issue.

Also, the documentation for sync https://docs.squidex.io/02-documentation/developer-guides/automation-tools states:
“Contents (this setting can be imported only)”
But I am able to export and import content with sync out/in?

Expected behavior

Syncs whatever the fields names are

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [x] Cloud version

Version: [CLI 9.6]

Others:

Can you show the content? It looks like some mismatch with field type (e.g. localized or invariant).

Schema json:
image
content json:

Renaming manually “title” to “homeTitle” in both json files and re-running the sync in worked

Does the schema have a title field already? Because changing the title from invariant to language requires the field to be recreated and the CLI does not do it by default (but you can enable it).

It’s possible that I had created the title field as invariant at the beginning, and then deleted and recreated as language, could this explain the issue?

For me it sounds more like the target schema has the title field as invariant.

Then sync in is run and the schema is not updated.

I have tried again with a clean schema and it worked, so it must have been that.
It would be nice that the sync recreates the field if its type has changed then, don’t you think?
Anyway, the issue is solved for me.
Last thing was my question about the documentation:
For sync https://docs.squidex.io/02-documentation/developer-guides/automation-tools states:
“Contents (this setting can be imported only)”
But I am able to export and import content with sync out/in. Is the doc outdated, or did I miss something?

Technically you could loose some data with this settings, especially if you go from localized to invariant.

Yes, it is outdated. Will be fixed.

1 Like