diff --git a/ckan/controllers/group.py b/ckan/controllers/group.py index f2ef3e499f7..54f92cb7b7e 100644 --- a/ckan/controllers/group.py +++ b/ckan/controllers/group.py @@ -857,9 +857,12 @@ def admins(self, id): return render(self._admins_template(c.group_dict['type'])) def about(self, id): + context = {'model': model, 'session': model.Session, + 'user': c.user or c.author} c.group_dict = self._get_group_dict(id) group_type = c.group_dict['type'] - self._setup_template_variables({}, {'id': id}, group_type=group_type) + self._setup_template_variables(context, {'id': id}, + group_type=group_type) return render(self._about_template(group_type)) def _get_group_dict(self, id): diff --git a/ckan/controllers/package.py b/ckan/controllers/package.py index 689b8e64355..32ce8f69ee1 100644 --- a/ckan/controllers/package.py +++ b/ckan/controllers/package.py @@ -1326,7 +1326,11 @@ def groups(self, id): except NotFound: abort(404, _('Group not found')) - removed_group = request.POST.get('group_removed') + removed_group = None + for param in request.POST: + if param.startswith('group_remove'): + removed_group = param.split('.')[-1] + break if removed_group: data_dict = {"id": removed_group, "object": id, diff --git a/ckan/controllers/user.py b/ckan/controllers/user.py index 4f30bb4ed91..d50ae617dbb 100644 --- a/ckan/controllers/user.py +++ b/ckan/controllers/user.py @@ -220,10 +220,17 @@ def _save_new(self, context): # Redirect to a URL picked up by repoze.who which performs the # login login_url = self._get_repoze_handler('login_handler_path') - h.redirect_to('%s?login=%s&password=%s' % ( + + # We need to pass the logged in URL as came_from parameter + # otherwise we lose the language setting + came_from = h.url_for(controller='user', action='logged_in', + __ckan_no_root=True) + redirect_url = '{0}?login={1}&password={2}&came_from={3}' + h.redirect_to(redirect_url.format( login_url, str(data_dict['name']), - quote(data_dict['password1'].encode('utf-8')))) + quote(data_dict['password1'].encode('utf-8')), + came_from)) else: # #1799 User has managed to register whilst logged in - warn user # they are not re-logged in as new user. diff --git a/ckan/logic/action/get.py b/ckan/logic/action/get.py index f56d64cb5a4..0f1bc219f14 100644 --- a/ckan/logic/action/get.py +++ b/ckan/logic/action/get.py @@ -1448,9 +1448,6 @@ def package_search(context, data_dict): # the query abort = data_dict.get('abort_search', False) - if data_dict.get('sort') in (None, 'rank'): - data_dict['sort'] = 'score desc, metadata_modified desc' - if data_dict.get('sort') in (None, 'rank'): data_dict['sort'] = 'score desc, metadata_modified desc' diff --git a/ckan/public/base/javascript/modules/custom-fields.js b/ckan/public/base/javascript/modules/custom-fields.js index 7124d27a763..3bd6daa0646 100644 --- a/ckan/public/base/javascript/modules/custom-fields.js +++ b/ckan/public/base/javascript/modules/custom-fields.js @@ -83,7 +83,6 @@ this.ckan.module('custom-fields', function (jQuery, _) { */ disableField: function (field, disable) { field.toggleClass('disabled', disable !== false); - field.find(':input:not(:checkbox)').prop('disabled', disable !== false); }, /* Event handler that fires when the last key in the custom field block diff --git a/ckan/public/base/test/spec/modules/custom-fields.spec.js b/ckan/public/base/test/spec/modules/custom-fields.spec.js index 99088cc5e9e..79e5d03187b 100644 --- a/ckan/public/base/test/spec/modules/custom-fields.spec.js +++ b/ckan/public/base/test/spec/modules/custom-fields.spec.js @@ -135,18 +135,6 @@ describe('ckan.module.CustomFieldsModule()', function () { assert.isTrue(this.target.hasClass('disabled')); }); - it('should set the disabled property on the input elements', function () { - this.module.disableField(this.target); - - this.target.find(':input').each(function () { - if (jQuery(this).is(':checkbox')) { - assert.isFalse(this.disabled, 'checkbox should not be disabled'); - } else { - assert.isTrue(this.disabled, 'input should be disabled'); - } - }); - }); - it('should remove a .disable class to the element if disable is false', function () { this.target.addClass('disable'); @@ -154,19 +142,6 @@ describe('ckan.module.CustomFieldsModule()', function () { assert.isFalse(this.target.hasClass('disabled')); }); - it('should unset the disabled property on the input elements if disable is false', function () { - this.target.find(':input:not(:checkbox)').prop('disabled', true); - - this.module.disableField(this.target, false); - - this.target.find(':input').each(function () { - if (jQuery(this).is(':checkbox')) { - assert.isFalse(this.disabled, 'checkbox should not be disabled'); - } else { - assert.isFalse(this.disabled, 'input should not be disabled'); - } - }); - }); }); describe('._onChange(event)', function () { diff --git a/ckan/templates/group/snippets/group_item.html b/ckan/templates/group/snippets/group_item.html index ca90dedd647..8d66988dd9e 100644 --- a/ckan/templates/group/snippets/group_item.html +++ b/ckan/templates/group/snippets/group_item.html @@ -36,7 +36,7 @@