Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

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

default discord avatar
face442 years 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
    nikich2 years 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
    face442 years ago
    fallback

    is exactly what I needed. Thank you so much

    @129224448338296832

    🤩

  • default discord avatar
    nikich2 years ago

    You’re welcome,

    @1072829108523901018


    Don’t forget to tag question as answered.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.