From c0b7da8be3eb2d225ff51a57ec905c9cc2c8376b Mon Sep 17 00:00:00 2001 From: Lukas Mueller Date: Thu, 27 Apr 2023 15:23:29 -0400 Subject: [PATCH] sometimes, traits will just be a scalar. Convert to list in that case so that downstream treatment is uniform. --- mason/stock/download_stock_phenotypes_dialog.mas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mason/stock/download_stock_phenotypes_dialog.mas b/mason/stock/download_stock_phenotypes_dialog.mas index 4b3f7b102..e80bd6a83 100644 --- a/mason/stock/download_stock_phenotypes_dialog.mas +++ b/mason/stock/download_stock_phenotypes_dialog.mas @@ -98,6 +98,10 @@ jQuery(document).ready(function() { var format = jQuery("#download_stock_phenotypes_format").val(); var timestamp = jQuery("#download_stock_phenotypes_timestamp_option").val(); var traits = jQuery("#download_stock_phenotypes_traits_select").val(); + if (! Array.isArray(traits) ) { + traits = [ traits ]; + } + var datalevel = jQuery("#download_stock_phenotypes_level_option").val(); var exclude_phenotype_outlier = jQuery("#download_stock_phenotypes_exclude_outliers").val(); window.open("/breeders/trials/phenotype/download?"+stock_type+"_list="+JSON.stringify(stock_id)+"&dataLevel="+datalevel+"&format="+format+"×tamp="+timestamp+"&trait_list="+JSON.stringify(traits)+"&exclude_phenotype_outlier="+exclude_phenotype_outlier); -- 2.11.4.GIT