diff --git a/lib/galaxy/managers/jobs.py b/lib/galaxy/managers/jobs.py index dc46534bb253..102d8b04f591 100644 --- a/lib/galaxy/managers/jobs.py +++ b/lib/galaxy/managers/jobs.py @@ -901,23 +901,24 @@ def inputs_recursive(input_params, param_values, depth=1, upgrade_messages=None) for input in input_params.values(): if input.name in param_values: + input_value = param_values[input.name] if input.type == "repeat": - for i in range(len(param_values[input.name])): - rval.extend(inputs_recursive(input.inputs, param_values[input.name][i], depth=depth + 1)) + for i in range(len(input_value)): + rval.extend(inputs_recursive(input.inputs, input_value[i], depth=depth + 1)) elif input.type == "section": # Get the value of the current Section parameter rval.append(dict(text=input.name, depth=depth)) rval.extend( inputs_recursive( input.inputs, - param_values[input.name], + input_value, depth=depth + 1, upgrade_messages=upgrade_messages.get(input.name), ) ) elif input.type == "conditional": try: - current_case = param_values[input.name]["__current_case__"] + current_case = input_value["__current_case__"] is_valid = True except Exception: current_case = None @@ -929,7 +930,7 @@ def inputs_recursive(input_params, param_values, depth=1, upgrade_messages=None) rval.extend( inputs_recursive( input.cases[current_case].inputs, - param_values[input.name], + input_value, depth=depth + 1, upgrade_messages=upgrade_messages.get(input.name), ) @@ -948,12 +949,16 @@ def inputs_recursive(input_params, param_values, depth=1, upgrade_messages=None) dict( text=input.group_title(param_values), depth=depth, - value=f"{len(param_values[input.name])} uploaded datasets", + value=f"{len(input_value)} uploaded datasets", ) ) - elif input.type == "data" or input.type == "data_collection": + elif ( + input.type == "data" + or input.type == "data_collection" + or isinstance(input_value, model.HistoryDatasetAssociation) + ): value = [] - for element in listify(param_values[input.name]): + for element in listify(input_value): element_id = element.id if isinstance(element, model.HistoryDatasetAssociation): hda = element @@ -977,7 +982,7 @@ def inputs_recursive(input_params, param_values, depth=1, upgrade_messages=None) dict( text=label, depth=depth, - value=input.value_to_display_text(param_values[input.name]), + value=input.value_to_display_text(input_value), notes=upgrade_messages.get(input.name, ""), ) ) diff --git a/lib/galaxy/tools/actions/__init__.py b/lib/galaxy/tools/actions/__init__.py index 80604f7976fa..cfce9b540692 100644 --- a/lib/galaxy/tools/actions/__init__.py +++ b/lib/galaxy/tools/actions/__init__.py @@ -32,6 +32,7 @@ DataCollectionToolParameter, DataToolParameter, RuntimeValue, + SelectToolParameter, ) from galaxy.tools.parameters.wrapped import ( LegacyUnprefixedDict, @@ -283,6 +284,8 @@ def process_dataset(data, formats=None): value.child_collection = new_collection else: value.collection = new_collection + elif isinstance(input, SelectToolParameter) and isinstance(value, HistoryDatasetAssociation): + input_datasets[prefixed_name] = value tool.visit_inputs(param_values, visitor) return input_datasets, all_permissions diff --git a/lib/galaxy/tools/evaluation.py b/lib/galaxy/tools/evaluation.py index 39247afde9e7..0624bf385dc0 100644 --- a/lib/galaxy/tools/evaluation.py +++ b/lib/galaxy/tools/evaluation.py @@ -406,7 +406,7 @@ def __populate_input_dataset_wrappers(self, param_dict, input_datasets): if wrapper: param_dict[name] = wrapper continue - if not isinstance(param_dict_value, (DatasetFilenameWrapper, DatasetListWrapper)): + if not isinstance(param_dict_value, ToolParameterValueWrapper): wrapper_kwds = dict( datatypes_registry=self.app.datatypes_registry, tool=self.tool, diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index d07ce44e70c4..3e2f54053008 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -1028,10 +1028,6 @@ def from_json(self, value, trans, other_values=None, require_legal_value=True): raise ParameterValueError( "requires a value, but no legal values defined", self.name, is_dynamic=self.is_dynamic ) - # TODO: dataset security check ?? - if dataset := history_item_dict_to_python(value, app=trans.app, name=self.name): - if dataset in legal_values: - return dataset if isinstance(value, list): if not self.multiple: raise ParameterValueError(