Skip to content
Snippets Groups Projects
Commit e0f7d156 authored by David Büchler's avatar David Büchler
Browse files

Fixed Bug in GetUnrelatedRelationsForDuplicate

Removed all loggings
Changed the constraint on nullable=false on Column CLUSTERID in unrelatedDuplicates. This is necessary because of the live view of the duplicates. If the duplicates arent determined beforehand and sorted into clusters, the creation of a unrelated relation would fail because the used duplicate is not in a cluster
parent c1c02636
No related branches found
No related tags found
No related merge requests found
......@@ -11,9 +11,7 @@
<column name="UNRELATEDDUPLICATEID" type="CHAR(36)" >
<constraints nullable="false"/>
</column>
<column name="CLUSTERID" type="CHAR(36)" >
<constraints nullable="false"/>
</column>
<column name="CLUSTERID" type="CHAR(36)" />
</createTable>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -752,7 +752,7 @@ DuplicateScannerUtils.BuildEntityFieldConfigValueRays = function(pDuplicateField
}
let valuelength = fieldConfig.length;
logging.log(valuelength)
if ( valuelength )
entityFieldValue = entityFieldValue.substr(0, parseInt(valuelength)) + "*";
......@@ -789,22 +789,18 @@ DuplicateScannerUtils.GetUnrelatedRelationsForDuplicate = function(pDuplicateId)
.where("UNRELATEDDUPLICATES.SOURCEDUPLICATEID", pDuplicateId)
.or("UNRELATEDDUPLICATES.UNRELATEDDUPLICATEID", pDuplicateId)
.table();
let sourceDuplicateId = "";
let unrelatedDuplicateId = "";
for (let i = 0; i < duplicateIds.length; i++)
{
sourceDuplicateId = duplicateIds[0];
unrelatedDuplicateId = duplicateIds[1];
if(sourceDuplicateId == pDuplicateId || unrelatedDuplicateId == pDuplicateId)
continue;
sourceDuplicateId = duplicateIds[i][0];
unrelatedDuplicateId = duplicateIds[i][1];
if(sourceDuplicateId != null && sourceDuplicateId != "")
if(sourceDuplicateId != null && sourceDuplicateId != "" && sourceDuplicateId != pDuplicateId)
{
unrelatedIds.push(sourceDuplicateId);
}
else if(unrelatedDuplicateId != null && unrelatedDuplicateId != "")
else if(unrelatedDuplicateId != null && unrelatedDuplicateId != "" && unrelatedDuplicateId != pDuplicateId)
{
unrelatedIds.push(unrelatedDuplicateId);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment