Skip to content

Commit 01b3045

Browse files
committed
Fixed bug trying to parse the new contact name from old templates
1 parent 7368404 commit 01b3045

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

assets/controllers/templates_controller.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export default class extends Controller {
3030
//Try to migrate old templates to new system
3131
for (const template of this._templates) {
3232
//Merge first and last name into the new submitter_name field
33-
if (template['first_name'] || template['last_name']) {
34-
template['submitter_name'] = `${template['first_name']} ${template['last_name']}`;
35-
delete template['first_name'];
36-
delete template['last_name'];
33+
if (template['data']['first_name'] || template['data']['last_name']) {
34+
template['data']['submitter_name'] = `${template['data']['first_name']} ${template['data']['last_name']}`;
35+
delete template['data']['first_name'];
36+
delete template['data']['last_name'];
3737
}
3838
}
3939
}

0 commit comments

Comments
 (0)