Skip to content

Commit

Permalink
[#2825] Fix language change issue with querystring params
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Aug 9, 2012
1 parent 704ad38 commit f7c68be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ckan/config/middleware.py
Expand Up @@ -202,9 +202,10 @@ def __call__(self, environ, start_response):

qs = environ.get('QUERY_STRING')
# sort out weird encodings
qs = urllib.quote(qs, '')

if qs:
environ['CKAN_CURRENT_URL_RAW'] = '%s?%s' % (path_info, qs)
qs = urllib.quote(qs, '')
environ['CKAN_CURRENT_URL'] = '%s?%s' % (path_info, qs)
else:
environ['CKAN_CURRENT_URL'] = path_info
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/snippets/language_selector.html
@@ -1,4 +1,4 @@
{% set current_url = request.environ.CKAN_CURRENT_URL %}
{% set current_url = request.environ.CKAN_CURRENT_URL_RAW %}
{% set current_lang = request.environ.CKAN_LANG %}
<form class="form-inline form-select lang-select" action="{% url_for controller='util', action='redirect' %}" data-module="select-switch" method="POST">
<label for="field-lang-select">{{ _('Language') }}</label>
Expand Down

0 comments on commit f7c68be

Please sign in to comment.