Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions api/src/org/labkey/api/assay/AbstractAssayTsvDataHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,17 @@ else if (entry.getKey().equalsIgnoreCase(ProvenanceService.PROVENANCE_INPUT_PROP
Object o = map.get(pd.getName());
if (PropertyType.MULTI_CHOICE == pd.getPropertyType())
{
o = MultiChoice.Converter.getInstance().convert(MultiChoice.Array.class, o);
map.put(pd.getName(), o);
try
{
// GitHub Issue 1082: Server exception "Badly formatted list of strings" on assay run import with invalid MVTC field value
o = MultiChoice.Converter.getInstance().convert(MultiChoice.Array.class, o);
map.put(pd.getName(), o);
}
catch (ConversionException e)
{
errors.add(new PropertyValidationError(e.getMessage(), pd.getName()));
}

}
else if (o instanceof String)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,23 @@ describe('assay-importRun.api', () => {
expect(response.text).toContain('One or more values cannot be removed from the multi-choice list');
});

// GitHub Issue 1082: Server exception "Badly formatted list of strings" on assay run import with invalid MVTC field value
it('illegal tsv string', async () => {
if (!supportMultiChoice) {
return;
}

const { topFolderOptions } = context;

// Import a run with ['Abnormal', 'cDNA'] as multi-choice values
const importPayload: ImportRunOptions = {
assayId: ASSAY_A_ID,
dataRows: [{ [RESULT_MVTC_FIELD_NAME]: ['""x,y""'] }],
};
const importResponse = await importRunToServer(server, importPayload, topFolderOptions);
expect(importResponse.body.exception).toContain('for field \'' + RESULT_MVTC_FIELD_NAME + '\' is invalid.');
});

// GitHub Issue 925: Not providing a MVTC value in an assay result throws error
it('errors when required MVTC column not provided in assay import', async () => {
if (!supportMultiChoice) {
Expand Down
Loading