feat(14.2.1-06): persist nested ML maps on relation-child create

RelationService looks up TranslationWriter like CRUDService so CreateChild can lift locale maps before fillChild, write Polish after the child PK, and return a hydrated title map.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jakub Zych
2026-10-06 15:51:38 +02:00
parent f4bea33faf
commit 88a3a88876
5 changed files with 225 additions and 6 deletions

View File

@@ -80,11 +80,11 @@ func (w *recordingWriter) EnabledLocales(context.Context, *gorm.DB) ([]string, e
}
func (w *recordingWriter) WriteTranslated(_ context.Context, _ *gorm.DB, model any, field, locale, value string) error {
post, _ := model.(*mlPost)
if post == nil || post.ID == 0 {
id := pkUint(model)
if id == 0 {
return &ValidationError{Details: map[string]any{field: []string{"translation writer ran before the host row had an id"}}}
}
w.ids = append(w.ids, post.ID)
w.ids = append(w.ids, id)
if w.attrs == nil {
w.attrs = map[string]map[string]string{}
}