diff --git a/lib/galaxy/tools/parameters/dynamic_options.py b/lib/galaxy/tools/parameters/dynamic_options.py
index 759457f4a6a..b10af39e191 100644
--- a/lib/galaxy/tools/parameters/dynamic_options.py
+++ b/lib/galaxy/tools/parameters/dynamic_options.py
@@ -157,6 +157,7 @@ class DataMetaFilter(Filter):
self.column = d_option.column_spec_to_index(self.column)
self.multiple = string_as_bool(elem.get("multiple", "False"))
self.separator = elem.get("separator", ",")
+ log.error(f"data_meta.init: ref_name {self.ref_name} key {self.key} column {self.column} multiple {self.multiple} separator {self.separator}")
def get_dependency_name(self):
return self.ref_name
@@ -271,14 +272,31 @@ class ParamValueFilter(Filter):
if trans is not None and trans.workflow_building_mode:
return []
ref = other_values.get(self.ref_name, None)
- for ref_attribute in self.ref_attribute:
- if not hasattr(ref, ref_attribute):
- return [] # ref does not have attribute, so we cannot filter, return empty list
- ref = getattr(ref, ref_attribute)
- ref = str(ref)
+ if ref is None:
+ ref = []
+
+ # - for HDCAs the list of contained HDAs is extracted
+ # - single values are transformed in a single eleent list
+ # - remaining cases are already lists (select and data parameters with multiple=true)
+ if isinstance(ref, HistoryDatasetCollectionAssociation):
+ ref = ref.to_hda_representative(multiple=True)
+ elif not isinstance(ref, list):
+ ref = [ref]
+
+ ref_values = []
+ for r in ref:
+ for ref_attribute in self.ref_attribute:
+ # ref does not have attribute, so we cannot filter,
+ # but other refs might have it
+ if not hasattr(r, ref_attribute):
+ break
+ r = getattr(r, ref_attribute)
+ ref_values.append(r)
+ ref_values = [str(_) for _ in ref_values]
+
rval = []
for fields in options:
- if self.keep == (fields[self.column] == ref):
+ if self.keep == (fields[self.column] in ref_values):
rval.append(fields)
return rval
@@ -666,10 +684,10 @@ class DynamicOptions:
try:
datasets = _get_ref_data(other_values, self.dataset_ref_name)
except KeyError: # no such dataset
- log.warning(f"could not create dynamic options from_dataset: {self.dataset_ref_name} unknown")
+ log.warning(f"Parameter {self.tool_param.name}: could not create dynamic options from_dataset: {self.dataset_ref_name} unknown")
return []
except ValueError: # not a valid dataset
- log.warning(f"could not create dynamic options from_dataset: {self.dataset_ref_name} not a data or collection parameter")
+ log.warning(f"Parameter {self.tool_param.name}: could not create dynamic options from_dataset: {self.dataset_ref_name} not a data or collection parameter")
return []
options = []
diff --git a/test/functional/tool-data/fasta_indexes.loc b/test/functional/tool-data/fasta_indexes.loc
index 57f11daa9a9..f733d49f42c 100644
--- a/test/functional/tool-data/fasta_indexes.loc
+++ b/test/functional/tool-data/fasta_indexes.loc
@@ -1,2 +1,4 @@
hg19_value hg19 hg19_name hg19_path
hg18_value hg18 hg18_name hg18_path
+mm10_value mm10 mm10_name mm10_path
+
diff --git a/test/functional/tools/filter_param_value.xml b/test/functional/tools/filter_param_value.xml
new file mode 100644
index 00000000000..9dc13e8a5a3
--- /dev/null
+++ b/test/functional/tools/filter_param_value.xml
@@ -0,0 +1,53 @@
+
+ Filter input with the param_value
+ '$output' &&
+ echo $select2 >> '$output'
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/functional/tools/filter_param_value_ref_attribute.xml b/test/functional/tools/filter_param_value_ref_attribute.xml
new file mode 100644
index 00000000000..68439df520f
--- /dev/null
+++ b/test/functional/tools/filter_param_value_ref_attribute.xml
@@ -0,0 +1,116 @@
+
+ Filter input with the param_value
+ > '$output' &&
+ #end if
+ #if $select_mult
+ echo $select_mult >> '$output' &&
+ #end if
+ #if $select_coll
+ echo $select_coll >> '$output' &&
+ #end if
+ true
+ ]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/functional/tools/samples_tool_conf.xml b/test/functional/tools/samples_tool_conf.xml
index 2b74faf87c9..92870be5a6e 100644
--- a/test/functional/tools/samples_tool_conf.xml
+++ b/test/functional/tools/samples_tool_conf.xml
@@ -47,6 +47,8 @@
+
+