sveltia / sveltia-cms

Alternative to Netlify/Decap CMS. Fast, lightweight, Git-based headless CMS. Modern UX, first-class i18n support, open source & free. Made with Svelte.
MIT License
750 stars 34 forks source link

if `identifier_field` is set (not default to title), `slug` has to be also set #56

Closed frankbits closed 10 months ago

frankbits commented 10 months ago

An entry can't be saved, if identifier_field is set, but not slug. identifier_field should also change the default of slug

https://decapcms.org/docs/configuration-options/#slug:

a different field can be used via identifier_field

Also it can't anymore be saved, if no title-field exists when no identifier_field or slug is set. I've had a collection set up this way, and it just saved the entries with a random id (chars and numbers).

kyoshino commented 10 months ago

In the previous versions of Sveltia CMS, if a slug could not be determined, it automatically used a random slug. I removed the fallback at some point because it might be confusing. I’ll fix the identifier_field issue and restore the fallback code.

kyoshino commented 10 months ago

The fix is in! Thanks for the report 💯

frankbits commented 10 months ago

I wouldn't have a problem with there being no random fallback. But either way it would be nice, if the error-message wouldn't just say "there was some error. try again later.", as this gives no info what caused it (had to search for a while) and "trying later" does nothing ...

kyoshino commented 10 months ago

I’ll improve the error message 😅