commit/galaxy-central: rc: Bug fix: checkbox values were not getting saved for samples in the sample grid. Issue #476
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/b54ef1e11b77/ changeset: r5113:b54ef1e11b77 user: rc date: 2011-02-23 17:56:16 summary: Bug fix: checkbox values were not getting saved for samples in the sample grid. Issue #476 affected #: 2 files (890 bytes) --- a/lib/galaxy/web/controllers/requests_common.py Wed Feb 23 10:40:30 2011 -0500 +++ b/lib/galaxy/web/controllers/requests_common.py Wed Feb 23 11:56:16 2011 -0500 @@ -1432,7 +1432,11 @@ field_values = {} for field_index, field in enumerate( request.type.sample_form.fields ): field_name = field['name'] - field_value = util.restore_text( params.get( 'sample_%i_field_%i' % ( index, field_index ), sample.values.content[ field_name ] ) ) + input_value = params.get( 'sample_%i_field_%i' % ( index, field_index ), sample.values.content[ field_name ] ) + if field['type'] == CheckboxField.__name__: + field_value = CheckboxField.is_checked( input_value ) + else: + field_value = util.restore_text( input_value ) field_values[ field_name ] = field_value library_select_field, folder_select_field = self.__build_library_and_folder_select_fields( trans=trans, user=request.user, @@ -1504,8 +1508,13 @@ workflow_dict['mappings'][int(k[len(kwd_tag):])] = {'ds_tag':v} field_values = {} for field_index, field in enumerate( request.type.sample_form.fields ): - field_name = field['name'] - field_values[ field_name ] = util.restore_text( params.get( 'sample_%i_field_%i' % ( index, field_index ), '' ) ) + field_name = field['name'] + input_value = params.get( 'sample_%i_field_%i' % ( index, field_index ), '' ) + if field['type'] == CheckboxField.__name__: + field_value = CheckboxField.is_checked( input_value ) + else: + field_value = util.restore_text( input_value ) + field_values[ field_name ] = field_value library_select_field, folder_select_field = self.__build_library_and_folder_select_fields( trans=trans, user=request.user, sample_index=index, --- a/templates/requests/common/common.mako Wed Feb 23 10:40:30 2011 -0500 +++ b/templates/requests/common/common.mako Wed Feb 23 11:56:16 2011 -0500 @@ -591,7 +591,11 @@ %endfor </select> %elif field_type == 'CheckboxField': - <input type="checkbox" name="sample_${index}_field_${field_index}" value="Yes"/> + %if field_value is True: + <input type="checkbox" name="sample_${index}_field_${field_index}" value="Yes" checked="checked"/><input type="hidden" name="sample_${index}_field_${field_index}" value="Yes"/> + %else: + <input type="checkbox" name="sample_${index}_field_${field_index}" value="Yes"/><input type="hidden" name="sample_${index}_field_${field_index}" value="Yes"/> + %endif %endif <div class="toolParamHelp" style="clear: both;"><i>${'('+field['required']+')' }</i> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket