Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboard_activity_list_html() doesn't pass the user id to activity_list_to_html() #2346

Closed
clementmouchet opened this issue Mar 13, 2015 · 1 comment

Comments

Projects
None yet
3 participants
@clementmouchet
Copy link

commented Mar 13, 2015

The load more functionality in the dashboard doesn't work, because the id that is used to query more data is not passed to the template.

I've fixed it by passing the context user id:

diff --git a/ckan/logic/action/get.py b/ckan/logic/action/get.py
index ad59266..2519744 100644
--- a/ckan/logic/action/get.py
+++ b/ckan/logic/action/get.py

@@ -3216,8 +3221,6 @@ def dashboard_activity_list_html(context, data_dict):
     The activity stream is rendered as a snippet of HTML meant to be included
     in an HTML page, i.e. it doesn't have any HTML header or footer.

-    :param id: the id or name of the user
-    :type id: string
     :param offset: where to start getting activity items from
         (optional, default: 0)
     :type offset: int
@@ -3233,6 +3236,7 @@ def dashboard_activity_list_html(context, data_dict):
     model = context['model']
     offset = data_dict.get('offset', 0)
     extra_vars = {
+        'id': model.User.get(context['user']).id,
         'controller': 'user',
         'action': 'dashboard',
         'offset': offset,

Will submit a PR asap

Engerrs pushed a commit to Engerrs/ckan that referenced this issue Oct 12, 2016

Yan
[ckan#2346] Dashboard_activity_list_html() dosen't pass user id
Load more don't work on Dashboard page, because dashboard_activity_list_html() don't pass id as an argument, so in activity-stream.js the user_activity_list_html() gives us an error.

Fix it by passing id from context as we do with model= context['model']. As a result context['user'] gives us the name of current user and we can use it, because user_activity_list_html() can take both id and username as id.

amercader added a commit that referenced this issue Oct 14, 2016

[#2346] Dashboard_activity_list_html() dosen't pass user id
Load more don't work on Dashboard page, because dashboard_activity_list_html() don't pass id as an argument, so in activity-stream.js the user_activity_list_html() gives us an error.

Fix it by passing id from context as we do with model= context['model']. As a result context['user'] gives us the name of current user and we can use it, because user_activity_list_html() can take both id and username as id.

amercader added a commit that referenced this issue Oct 14, 2016

[#2346] Dashboard_activity_list_html() dosen't pass user id
Load more don't work on Dashboard page, because dashboard_activity_list_html() don't pass id as an argument, so in activity-stream.js the user_activity_list_html() gives us an error.

Fix it by passing id from context as we do with model= context['model']. As a result context['user'] gives us the name of current user and we can use it, because user_activity_list_html() can take both id and username as id.

amercader added a commit that referenced this issue Oct 14, 2016

[#2346] Dashboard_activity_list_html() dosen't pass user id
Load more don't work on Dashboard page, because dashboard_activity_list_html() don't pass id as an argument, so in activity-stream.js the user_activity_list_html() gives us an error.

Fix it by passing id from context as we do with model= context['model']. As a result context['user'] gives us the name of current user and we can use it, because user_activity_list_html() can take both id and username as id.
@kmbn

This comment has been minimized.

Copy link
Collaborator

commented Jan 22, 2019

We decided to close old issues that are not actively worked on so that we can focus our effort and attention on issues affecting the current versions of CKAN.

If this issue is still affecting the version of CKAN you're working with now, please feel free to comment or reopen the issue.

If you do reopen this issue, please update it with new details. One reason it might not have been resolved in the past is that it wasn't clear how a contributor could address the issue.

@kmbn kmbn closed this Jan 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.