Commit bfdabca
fix: replace hardcoded FieldTypeId comparisons with DB lookups
EFormService.cs (template duplication):
- CreateFields() had `if (field.FieldTypeId == 17)` to detect FieldGroup.
The DB auto-increments FieldType.Id, so 17 is not guaranteed to be
FieldGroup. Now queries FieldTypes table by Constants.FieldTypes.FieldGroup.
This was the root cause of corrupted FieldTypeIds when duplicating eforms.
EformCaseReportService.cs (case reports):
- Two places had `x.Field.FieldTypeId == 5` to filter Picture fields.
Now queries FieldTypes table by Constants.FieldTypes.Picture.
There are additional hardcoded IDs in plugin repos (Workflow, ItemsPlanning,
BackendConfiguration report service) that need the same fix separately.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9d6c059 commit bfdabca
File tree
2 files changed
+9
-3
lines changed- eFormAPI/eFormAPI.Web/Services
2 files changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
937 | 940 | | |
938 | 941 | | |
939 | 942 | | |
940 | | - | |
| 943 | + | |
941 | 944 | | |
942 | 945 | | |
943 | 946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
155 | 158 | | |
156 | 159 | | |
157 | | - | |
| 160 | + | |
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
| |||
290 | 293 | | |
291 | 294 | | |
292 | 295 | | |
293 | | - | |
| 296 | + | |
294 | 297 | | |
295 | 298 | | |
296 | 299 | | |
| |||
0 commit comments