Commit 6fae716
fix: preserve source locale when duplicating content
duplicate() built the copy's slug against the source row's locale but
inserted the row without one, so create()'s fallback landed every copy
in 'en'. On locale-scoped admin lists the copy silently vanished, and
the mis-scoped slug-uniqueness check could trip the UNIQUE(slug, locale)
constraint when the generated slug already existed in 'en'.
Pass the source locale through to create(). Duplicates keep their own
fresh translation group — a copy is a new entry, not a translation —
which create() already does by default; a test now locks that in.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017m3BaSx6e1DQcU77hBLTxU1 parent be8e8da commit 6fae716
3 files changed
Lines changed: 53 additions & 0 deletions
File tree
- .changeset
- packages/core
- src/database/repositories
- tests/integration/i18n
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
192 | 239 | | |
193 | 240 | | |
194 | 241 | | |
| |||
0 commit comments