Skip to content

Commit 00d026f

Browse files
committed
Silent cleanup of picklist items to align with MULTIVALUED_DELIMITER
1 parent 96e7dd7 commit 00d026f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/DataHarmonizer.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -2781,9 +2781,19 @@ class DataHarmonizer {
27812781

27822782
if (datatype === 'Provenance') {
27832783
checkProvenance(cellChanges, fullVersion, cellVal, row, col);
2784-
} else if (field.flatVocabulary) {
2784+
}
2785+
// Clean up capitalization and spacing. This applies to both single
2786+
// and multivalued
2787+
else if (field.flatVocabulary) {
27852788
if (field.multivalued === true) {
2786-
const [, update] = validateValsAgainstVocab(cellVal, field);
2789+
let [, update] = validateValsAgainstVocab(cellVal, field);
2790+
if (!update) {
2791+
// Inefficient 2nd check: problem is cellVal containing only
2792+
// caps or non-trimmed items doesn't trigger quiet update
2793+
const update_val = formatMultivaluedValue(parseMultivaluedValue(cellVal));
2794+
if (cellVal != update_val)
2795+
update = update_val;
2796+
}
27872797
if (update) {
27882798
data[row][col] = update;
27892799
cellChanges.push([row, col, update, 'thisChange']);

0 commit comments

Comments
 (0)