diff --git a/lib/galaxy/tools/parameters/__init__.py b/lib/galaxy/tools/parameters/__init__.py index 9beafc44969..3f91f636cec 100644 --- a/lib/galaxy/tools/parameters/__init__.py +++ b/lib/galaxy/tools/parameters/__init__.py @@ -115,5 +115,5 @@ def params_to_incoming( incoming, inputs, input_values, app, name_prefix="" ): incoming[ new_name_prefix + input.test_param.name ] = values[ input.test_param.name ] params_to_incoming( incoming, input.cases[current].inputs, values, app, new_name_prefix ) else: - incoming[ name_prefix + input.name ] = input.to_string( input_values.get( input.name ), app ) + incoming[ name_prefix + input.name ] = input.to_html_value( input_values.get( input.name ), app ) diff --git a/lib/galaxy/tools/parameters/basic.py b/lib/galaxy/tools/parameters/basic.py index 1ad38ec5ff5..d6d2352ca8c 100644 --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -106,6 +106,10 @@ class ToolParameter( object ): """ return value + def to_html_value( self, value, app ): + """Convert an object value to the value expected from an html post""" + return self.to_string( value, app ) + def to_string( self, value, app ): """Convert a value to a string representation suitable for persisting""" return str( value ) @@ -370,6 +374,11 @@ class BooleanToolParameter( ToolParameter ): return form_builder.CheckboxField( self.name, checked, refresh_on_change = self.refresh_on_change ) def from_html( self, value, trans=None, other_values={} ): return form_builder.CheckboxField.is_checked( value ) + def to_html_value( self, value, app ): + if value: + return [ 'true', 'true' ] + else: + return [ 'true' ] def to_python( self, value, app ): return ( value == 'True' ) def get_initial_value( self, trans, context ):