-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle non-localized content-types in discard-draft migration #20422
Handle non-localized content-types in discard-draft migration #20422
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the PR looks good but sounds like we might want to fix this inside discardDraft (or both)
packages/core/core/src/migrations/database/5.0.0-discard-drafts.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a build error from the discardDraft typings, but other than that LGTM
const isLocalized = strapi | ||
.plugin('i18n') | ||
.service('content-types') | ||
.isLocalizedContentType(oldContentType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure whether we wanted to target the old CT or the new one since I'm not sure about what we're trying to achieve exactly.
cc @Marc-Roig for confirmation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should target the new one
You would make a PM happy by resolving this PR, it's preventing me to have a data migration done |
Even on the latest beta (14) ? |
@Convly yes, the issue is still there while migrating from v4 to v5 (using beta(14)) |
Wait, how is it possible to expect localized admin users, is it the wanted behavior in the new i18n implementation @Marc-Roig? |
@Convly all content types are expected to have the locale column atm |
What does it do?
Adds a check to conditionally set locale in the
discardDraft
's params.Why is it needed?
This can break app with no i18n
See #20225
How to test it?
See reproduction steps in #20225
Related issue(s)/PR(s)
fix #20225