Skip to content
Snippets Groups Projects
Commit 193338a4 authored by buczekp's avatar buczekp
Browse files

[LMS-1676] fixed registration of sample with more than 1 parent

SVN: 17371
parent d04e374d
No related branches found
No related tags found
No related merge requests found
......@@ -143,10 +143,14 @@ abstract class AbstractSampleBusinessObject extends AbstractSampleIdentifierBusi
if (sampleIdentifier.isSpaceLevel())
{
final String spaceCode = sampleIdentifier.getSpaceLevel().getSpaceCode();
final List<SamplePE> parentPEs = new ArrayList<SamplePE>();
for (SampleIdentifier si : parentIdentifiers)
{
IdentifierHelper.fillAndCheckGroup(si, spaceCode);
IdentifierHelper.fillGroupIfNotSpecified(si, spaceCode);
SamplePE parent = getSampleByIdentifier(si);
parentPEs.add(parent);
}
addParents(samplePE, parentPEs);
}
}
String containerIdentifier = newSample.getContainerIdentifier();
......
......@@ -254,4 +254,12 @@ public final class IdentifierHelper
"Sample '%s' does not belong to the space '%s'", sample, expectedGroupCode));
}
}
static public void fillGroupIfNotSpecified(SampleIdentifier sample, String defaultGroupCode)
{
if (sample.isInsideHomeGroup())
{
sample.getSpaceLevel().setSpaceCode(defaultGroupCode);
}
}
}
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