[hg] galaxy 3243: Fix unicode bug when displaying dataset names ...
details: http://www.bx.psu.edu/hg/galaxy/rev/54a31dda709b changeset: 3243:54a31dda709b user: jeremy goecks <jeremy.goecks@emory.edu> date: Thu Jan 14 15:13:01 2010 -0500 description: Fix unicode bug when displaying dataset names in HTML select boxes in tool forms. diffstat: templates/tool_form.mako | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diffs (22 lines): diff -r 5d5e5da2fcda -r 54a31dda709b templates/tool_form.mako --- a/templates/tool_form.mako Thu Jan 14 14:20:01 2010 -0500 +++ b/templates/tool_form.mako Thu Jan 14 15:13:01 2010 -0500 @@ -161,10 +161,15 @@ </label> %endif <% - field = param.get_html_field( trans, parent_state[ param.name ], other_values ) - field.refresh_on_change = param.refresh_on_change + field = param.get_html_field( trans, parent_state[ param.name ], other_values ) + field.refresh_on_change = param.refresh_on_change + + # Field may contain characters submitted by user and these characters may be unicode; handle non-ascii characters gracefully. + field_html = field.get_html( prefix ) + if field_html is not unicode: + field_html = unicode( field_html, 'utf-8' ) %> - <div class="form-row-input">${field.get_html( prefix )}</div> + <div class="form-row-input">${field_html}</div> %if parent_errors.has_key( param.name ): <div class="form-row-error-message"> <div><img style="vertical-align: middle;" src="${h.url_for('/static/style/error_small.png')}"> <span style="vertical-align: middle;">${parent_errors[param.name]}</span></div>
participants (1)
-
Greg Von Kuster