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

Pagination breaks organization display #40

Open
pdekraker-epa opened this issue Oct 11, 2019 · 3 comments
Open

Pagination breaks organization display #40

pdekraker-epa opened this issue Oct 11, 2019 · 3 comments

Comments

@pdekraker-epa
Copy link

I see this behavior on both CKAN 2.7 and 2.8. I have 32 organizations 5 top-level that each have 4-7 sub-organizations. This many organizations causes the interface to add a pager, which breaks the display of all organizations with some child organizations being displayed individually & repeated with the proper hierarchy on the 2nd page. A simple solution for my case could be to disable paging / allow more items per page, but I am unsure where this is changed.

@clauded
Copy link

clauded commented Dec 12, 2019

Is there a work around for this as I have the same problem?

@pdekraker-epa
Copy link
Author

If you have more than 20, but not a ton I do have a workaround:

The underlying issue is that the organization list display controller (in base ckan) is set to return a specified number of items per page. It searches and finds the matching organizations (limited to 21 items per page) and passes them to the hierarchy plugin to display. The hierarchy plugin then tries to build the tree, but it is missing pieces because of the per page limit.

The easiest solution is to edit the CKAN group controller here to be a number larger than your number of organizations:
https://github.com/ckan/ckan/blob/197f9b19254dad3056d1418d4bbfc5c604b39c4e/ckan/controllers/group.py#L144

FYI, It looks like future versions of CKAN will use the datasets_per_page config variable to determine the limit.

@clauded
Copy link

clauded commented Dec 12, 2019

Thanks for the tip but when you think about it, pagination don't make sens with this module as it will always break the display of the tree.

I tried to use the following in templates/organization/index.html of the ckan core module:
{% snippet "organization/snippets/organization_list.html", organizations=organizations, show_capacity=True %}

This will display the whole tree. Unfortunatly, when I use search, highlight of results dont work. So for the moment, your solution works better but I'm sure it can be fixed in this module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants