CE-882 in case field doesn't have label, use fieldName in some cases (helps w/ tests that don't enrich)

This commit is contained in:
2024-04-24 08:47:04 -05:00
parent 8a74609c51
commit 97b17085be
2 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ public class DMLAuditAction extends AbstractQActionFunction<DMLAuditInput, DMLAu
// sort the field names by their labels // // sort the field names by their labels //
////////////////////////////////////////// //////////////////////////////////////////
List<String> sortedFieldNames = table.getFields().keySet().stream() List<String> sortedFieldNames = table.getFields().keySet().stream()
.sorted(Comparator.comparing(fieldName -> table.getFields().get(fieldName).getLabel())) .sorted(Comparator.comparing(fieldName -> Objects.requireNonNullElse(table.getFields().get(fieldName).getLabel(), fieldName)))
.toList(); .toList();
QFieldMetaData primaryKeyField = table.getField(table.getPrimaryKeyField()); QFieldMetaData primaryKeyField = table.getField(table.getPrimaryKeyField());

View File

@ -470,7 +470,7 @@ public class DeleteAction
QRecord recordWithError = new QRecord(); QRecord recordWithError = new QRecord();
recordsWithErrors.add(recordWithError); recordsWithErrors.add(recordWithError);
recordWithError.setValue(primaryKeyField.getName(), primaryKeyValue); recordWithError.setValue(primaryKeyField.getName(), primaryKeyValue);
recordWithError.addError(new NotFoundStatusMessage("No record was found to delete for " + primaryKeyField.getLabel() + " = " + primaryKeyValue)); recordWithError.addError(new NotFoundStatusMessage("No record was found to delete for " + Objects.requireNonNullElse(primaryKeyField.getLabel(), primaryKeyField.getName()) + " = " + primaryKeyValue));
} }
} }
} }