Skip to content

Commit

Permalink
Fix migrating save actions with field=first_name
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Apr 17, 2018
1 parent f86603f commit 967bd6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion legacy/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ func migrateAction(baseLanguage utils.Language, a Action, localization flows.Loc
// we can emulate setting only the first name with an expression
if a.Field == "first_name" {
migratedValue = strings.TrimSpace(migratedValue)
migratedValue = fmt.Sprintf("%s @(word_slice(contact.name, 2, -1))", migratedValue)
migratedValue = fmt.Sprintf("%s @(word_slice(contact.name, 1, -1))", migratedValue)
}

return &actions.SetContactPropertyAction{
Expand Down
2 changes: 1 addition & 1 deletion legacy/testdata/migrations/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
"type": "set_contact_property",
"uuid": "5a4d00aa-807e-44af-9693-64b9fdedd352",
"property": "name",
"value": "@run.input @(word_slice(contact.name, 2, -1))"
"value": "@run.input @(word_slice(contact.name, 1, -1))"
},
"expected_localization": {}
},
Expand Down

0 comments on commit 967bd6b

Please sign in to comment.