Skip to content

Commit

Permalink
Fix selecting the correct item from select list
Browse files Browse the repository at this point in the history
select lists don't take a `value` argument.
  • Loading branch information
mvdbeek authored and jmchilton committed Nov 6, 2018
1 parent 99c270f commit b0d64a8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/galaxy/workflow/modules.py
Expand Up @@ -607,14 +607,20 @@ def get_inputs(self):
optional = self.state.inputs.get("optional", self.default_optional)
input_parameter_type = SelectToolParameter(None, XML(
'''
<param name="parameter_type" label="Parameter type" type="select" value="%s">
<param name="parameter_type" label="Parameter type" type="select">
<option value="text">Text</option>
<option value="integer">Integer</option>
<option value="float">Float</option>
<option value="boolean">Boolean (True or False)</option>
<option value="color">Color</option>
</param>
''' % parameter_type))
'''))
for i, option in enumerate(input_parameter_type.static_options):
option = list(option)
if option[1] == parameter_type:
# item 0 is option description, item 1 is value, item 2 is "selected"
option[2] = True
input_parameter_type.static_options[i] = tuple(option)
return odict([("parameter_type", input_parameter_type),
("optional", BooleanToolParameter(None, Element("param", name="optional", label="Optional", type="boolean", value=optional)))])

Expand Down

0 comments on commit b0d64a8

Please sign in to comment.