mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
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:
@ -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());
|
||||||
|
@ -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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user