From 85921101fc534220f87d687037a798ce56704b25 Mon Sep 17 00:00:00 2001 From: William Newman <3382274+newmanw@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:31:29 -0600 Subject: [PATCH] [service] prepend form name to all event form fields for clarity and to avoid ESRI column name conflicts --- plugins/arcgis/service/src/FeatureServiceAdmin.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/arcgis/service/src/FeatureServiceAdmin.ts b/plugins/arcgis/service/src/FeatureServiceAdmin.ts index 701e8e76a..eb371c84a 100644 --- a/plugins/arcgis/service/src/FeatureServiceAdmin.ts +++ b/plugins/arcgis/service/src/FeatureServiceAdmin.ts @@ -352,16 +352,13 @@ export class FeatureServiceAdmin { * @param fieldNames set of all field names */ private createFormField(form: Form, formField: FormField, fields: Field[], fieldNames: Set) { - const field = this.initField(formField.type) if (field != null) { - - let name = ObservationsTransformer.replaceSpaces(formField.title) - - if (fieldNames.has(name)) { - name = form.name + '_' + name - } + const sanitizedName = ObservationsTransformer.replaceSpaces(formField.title) + const sanitizedFormName = ObservationsTransformer.replaceSpaces(form.name) + const name = `${sanitizedFormName}_${sanitizedName}` + fieldNames.add(name) field.name = name @@ -372,7 +369,6 @@ export class FeatureServiceAdmin { fields.push(field) } - } /**