From 983d0f7e84be83a58283a43dd5a804c0ff63b065 Mon Sep 17 00:00:00 2001 From: Jinil Lee Date: Thu, 9 May 2019 23:13:47 +0900 Subject: [PATCH 1/2] Facet filtering does not work in 'group.read' or 'organization.read' pages fixing parameter is not included when redirecting --- ckan/views/group.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ckan/views/group.py b/ckan/views/group.py index e920e2841f6..4e94ade34f9 100644 --- a/ckan/views/group.py +++ b/ckan/views/group.py @@ -466,8 +466,10 @@ def read(group_type, is_organization, id=None, limit=20): # if the user specified a group id, redirect to the group name if data_dict['id'] == group_dict['id'] and \ data_dict['id'] != group_dict['name']: - return h.redirect_to(u'{}.read'.format(group_type), - id=group_dict['name']) + return h.redirect_to( + h.add_url_param( + controller=group_type, action=u'read', + extras=dict(id=group_dict['name']))) # TODO: Remove # ckan 2.9: Adding variables that were removed from c object for From 1b3f1c3802a6fc54b7fda7706534b7025bc7cbac Mon Sep 17 00:00:00 2001 From: Jinil Lee Date: Thu, 16 May 2019 00:49:57 +0900 Subject: [PATCH 2/2] building url without controller and action --- ckan/views/group.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ckan/views/group.py b/ckan/views/group.py index 4e94ade34f9..71f304d3ca9 100644 --- a/ckan/views/group.py +++ b/ckan/views/group.py @@ -466,10 +466,12 @@ def read(group_type, is_organization, id=None, limit=20): # if the user specified a group id, redirect to the group name if data_dict['id'] == group_dict['id'] and \ data_dict['id'] != group_dict['name']: + + url_with_name = h.url_for(u'{}.read'.format(group_type), + id=group_dict['name']) + return h.redirect_to( - h.add_url_param( - controller=group_type, action=u'read', - extras=dict(id=group_dict['name']))) + h.add_url_param(alternative_url=url_with_name)) # TODO: Remove # ckan 2.9: Adding variables that were removed from c object for