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

NDEV-50 Sort on column or index is not valid #239

Merged
merged 2 commits into from
Aug 30, 2017

Conversation

nihadness
Copy link
Contributor

There is a bug/confusion in bika_listing's sorting algorithm.
We know that there is 'columns' dictionary in each listing view. Each item in that dictionary contains 'id' of the column and different options of that column.

self.columns = {
            'getRequestID': {
                'title': _('Request ID'),
                'attr': 'getId',
                'replace_url': 'absolute_url',
                'index': 'getId'},
            'getClientOrderNumber': {
                'title': _('Client Order'),
                'sortable': False,
                'toggle': True},
         }

One of the keys of column values is 'index' which must be used to sort folder items, if its column has chosen to be sorted on. It works properly when clicked on table headers to sort. However, when 'review_states' is changed, that 'sort_on' fails. Apparently, the reason underlies URL of 'review_state' buttons. The URLs should contain column ID where now they directly contain index ID.

@nihadness nihadness requested a review from Espurna August 30, 2017 10:16
@Espurna Espurna merged commit 687ece7 into wip Aug 30, 2017
@xispa xispa deleted the bug/NDEV-50-sort_on-columns-index-is-not-valid branch September 1, 2017 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants