Skip to content

Commit 11639d7

Browse files
committed
Remove protection against existing parent aliases colliding field names
1 parent bc5f60e commit 11639d7

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

api/src/org/labkey/api/exp/api/ExperimentService.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -617,16 +617,13 @@ static void validateParentAlias(Map<String, String> aliasMap, Set<String> reserv
617617

618618
if (updatedDomainDesign != null)
619619
{
620-
if (!existingAliases.contains(trimmedKey))
620+
var field = updatedDomainDesign.getFieldByName(trimmedKey);
621+
if (field != null)
621622
{
622-
var field = updatedDomainDesign.getFieldByName(trimmedKey);
623-
if (field != null)
624-
{
625-
throw new IllegalArgumentException(String.format("An existing %1$s property conflicts with parent alias header: %2$s", dataTypeNoun, trimmedKey));
626-
}
623+
throw new IllegalArgumentException(String.format("An existing %1$s property conflicts with parent alias header: %2$s", dataTypeNoun, trimmedKey));
627624
}
628625
// GH Issue 1257: If there are conflicts with import aliases, this should be an error since it produces ambiguity during import
629-
var field = updatedDomainDesign.getFieldByImportAlias(trimmedKey);
626+
field = updatedDomainDesign.getFieldByImportAlias(trimmedKey);
630627
if (field != null)
631628
{
632629
throw new IllegalArgumentException(String.format("Field '%1$s' has an import alias '%2$s' that conflicts with a parent alias header.", field.getName(), trimmedKey));

0 commit comments

Comments
 (0)