Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,12 @@ private void addObsVarsToDatasetDetails(PendingImportObject<BrAPIListDetails> pi
BrAPIListDetails details = pio.getBrAPIObject();
referencedTraits.forEach(trait -> {
String id = Utilities.appendProgramKey(trait.getObservationVariableName(), program.getKey());

// Don't append the key if connected to a brapi service operating with legacy data(no appended program key)
if (trait.getFullName() == null) {
id = trait.getObservationVariableName();
}

if (!details.getData().contains(id) && ImportObjectState.EXISTING != pio.getState()) {
details.getData().add(id);
}
Expand Down Expand Up @@ -1582,4 +1588,4 @@ private String seasonDbIdToYearFromDatabase(String seasonDbId, UUID programId) {
Integer yearInt = (season == null) ? null : season.getYear();
return (yearInt == null) ? "" : yearInt.toString();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ private List<Trait> createTraits(int numToCreate) {
String varName = "tt_test_" + (i + 1);
traits.add(Trait.builder()
.observationVariableName(varName)
.fullName(varName)
.entity("Plant " + i)
.attribute("height " + i)
.traitDescription("test")
Expand Down