is there a way to prevent publish if content for one of the locale is not added?

default discord avatar
face44
3 months ago
3

I have this setup where I'm rebuilding a Nextjs site whenever a collection is published.



There are events when users create a document and publish it without updating fields for other locales (because the publish button allows them to, even when the required fields are empty).



This results in failure of the build and the previous build also gets crashed causing the site to give random errors of course.



In this context, what would be the best way to just ensure validation of fields for all available locales before allowing to publish the document?

  • default discord avatar
    nikich
    3 months ago

    Hey, I asked pretty the same question here:

    https://discord.com/channels/967097582721572934/1116318117023457401

    but I'm gonna use it for different purpose.



    I do wonder why your build fails? If your collection is not fully translated, it will automatically fallback to default language and return all the data as usual.

  • default discord avatar
    face44
    3 months ago
    fallback

    is exactly what I needed. Thank you so much @nikich 🤩

  • default discord avatar
    nikich
    3 months ago

    You’re welcome, @face44


    Don’t forget to tag question as answered.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.