Skip to content

Commit b0ca2ed

Browse files
author
Adam Rutland
authored
Merge pull request #435 from jfgarcia268/master
Fix findMatchingLookupRecordSourceKey returning undefined VlocityLoo…
2 parents 540a8c4 + a3256c0 commit b0ca2ed

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/datapackserrorhandling.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -404,21 +404,21 @@ DataPacksErrorHandling.prototype.findMatchingLookupRecordSourceKey = function(da
404404
for (var i = 0; i < searchPathMap.searchPath.length; i++) {
405405
if (dataPack.hasOwnProperty(searchPathMap.searchPath[i])) {
406406
var nodeVal = dataPack[searchPathMap.searchPath[i]];
407-
408407
if (searchPathMap.compareValues) {
408+
var match = 0;
409409
for (var z = 0; z < searchPathMap.compareValues.length; z++) {
410-
var allMatch = true;
411410
for (var key in searchPathMap.compareValues[z]) {
412411
if (nodeVal.hasOwnProperty(key)) {
413-
if (nodeVal[key] !== searchPathMap.compareValues[z][key]) {
414-
allMatch = false;
412+
if (nodeVal[key] === searchPathMap.compareValues[z][key]) {
413+
match++;
415414
//return nodeVal.VlocityLookupRecordSourceKey;
416415
}
417416
}
418417
}
419-
if(allMatch){
420-
return nodeVal.VlocityLookupRecordSourceKey;
421-
}
418+
419+
}
420+
if(match == searchPathMap.compareValues.length){
421+
return nodeVal.VlocityLookupRecordSourceKey;
422422
}
423423
}
424424

0 commit comments

Comments
 (0)