@@ -1989,18 +1989,25 @@ public String nextName(Map<String, Object> map,
1989
1989
@ Nullable Set <ExpMaterial > parentSamples ,
1990
1990
@ Nullable List <Supplier <Map <String , Object >>> _extraPropsFns ) throws NameGenerator .NameGenerationException
1991
1991
{
1992
- boolean isAliquot = (boolean ) map .getOrDefault (ALIQUOT_FROM_IS_ALIQUOT , false );
1993
- if (isAliquot )
1992
+ String aliquotedFrom = null ;
1993
+ Object aliquotedFromObj = map .get (ExpMaterial .ALIQUOTED_FROM_INPUT );
1994
+ if (aliquotedFromObj != null )
1994
1995
{
1995
- // Issue 53153: When a name has been resolved for the aliquot,
1996
- // then use that instead of the supplied value for AliquotedFrom.
1997
- Object name = map .get (ALIQUOT_FROM_RESOLVED_NAME );
1998
- if (name instanceof String aliquotParentName )
1999
- map .put (ExpMaterial .ALIQUOTED_FROM_INPUT , aliquotParentName );
2000
- else if (name instanceof List <?> nameList )
2001
- map .put (ExpMaterial .ALIQUOTED_FROM_INPUT , nameList .get (0 ));
1996
+ if (aliquotedFromObj instanceof String )
1997
+ {
1998
+ // Issue 45563: We need the AliquotedFrom name to be quoted so we can properly find the parent,
1999
+ // but we don't want to include the quotes in the name we generate using AliquotedFrom
2000
+ aliquotedFrom = StringUtilsLabKey .unquoteString ((String ) aliquotedFromObj ).trim ();
2001
+ map .put (ExpMaterial .ALIQUOTED_FROM_INPUT , aliquotedFrom );
2002
+ }
2003
+ else if (aliquotedFromObj instanceof Number )
2004
+ {
2005
+ aliquotedFrom = aliquotedFromObj .toString ();
2006
+ }
2002
2007
}
2003
2008
2009
+ boolean isAliquot = !StringUtils .isEmpty (aliquotedFrom );
2010
+
2004
2011
String generatedName = null ;
2005
2012
if (isAliquot && aliquotNameGenerator != null )
2006
2013
generatedName = nextName (map , parentDatas , parentSamples , _extraPropsFns , aliquotNameGenerator );
0 commit comments