Skip to content

Conversation

@boazpoolman
Copy link
Member

@boazpoolman boazpoolman commented Apr 24, 2025

Addresses #172

@boazpoolman boazpoolman changed the title feat: add locale value + debug process with console.log Make the plugin work with internationalization Apr 24, 2025
@TMSchipper TMSchipper self-assigned this Apr 28, 2025
@TMSchipper
Copy link
Contributor

@boazpoolman I've fixed this issue.

Because validateEntityCreation() doesn't accept a fourth parameter and because we never checked if a publication already existed in that locale, everything was treated as a "new publication" so the first document only got the validation/action.
If a document is already published we now use: await strapi.entityValidator.validateEntityUpdate()

@boazpoolman boazpoolman marked this pull request as ready for review April 29, 2025 08:15
Copy link
Member Author

@boazpoolman boazpoolman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, Tim!

I left a couple comments, but nothing major.
I'm still wondering why the validation logic needs to be changed, but I'll double check that as soon as I do some actual testing with it.

status: 'draft',
});

const isLocalized = !!strapi.contentType(record.entitySlug).pluginOptions?.i18n?.localized;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct that this constant is not used?

@boazpoolman boazpoolman merged commit de91d38 into master May 12, 2025
@boazpoolman boazpoolman deleted the fix/172-internationalization-with-publish-actions branch May 12, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants