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

Allow for the deselection of sorting filters #15029

Merged
merged 2 commits into from
Aug 16, 2019
Merged

Allow for the deselection of sorting filters #15029

merged 2 commits into from
Aug 16, 2019

Conversation

reecebenson
Copy link
Contributor

@reecebenson reecebenson commented Aug 13, 2019

Overview

Unable to remove sorting filters on reports, "removing" them and refreshing the results would retain the sorting filters regardless.

Steps to Reproduce

  1. Go to CiviCRM dmaster
  2. Navigate Reports -> Contact Reports
  3. Select "Constituent Summary"
  4. Open the "Sorting" tab
  5. Add several Columns for sorting
  6. Click "Refresh Results"
  7. Open the "Sorting" tab
  8. Delete several added Columns.
  9. Click "Refresh Results"
  10. Open the "Sorting" tab again, columns reappear.

Bug

Before

The IDs of the Column and Order elements did not reflect the same element IDs used to reset the values.

After

The IDs of the Column and Order elements now reflect the same element IDs used to reset the values. Successfully able to remove sorting filters.

Technical Details

Fixes incorrect element IDs used in JavaScript.

@civicrm-builder
Copy link

Can one of the admins verify this patch?

@civibot
Copy link

civibot bot commented Aug 13, 2019

(Standard links)

@civibot civibot bot added the master label Aug 13, 2019
@eileenmcnaughton
Copy link
Contributor

add to whitelist

@eileenmcnaughton
Copy link
Contributor

@reecebenson that's for the PR - we'll see if we can get someone to give it a quick r-run & then it will be mergeable - I don't see any technical issue with the approach / your conclusions

Is this your first PR to CiviCRM? If so we'll need a second PR from you .... - adding you to our contributors file - https://github.com/civicrm/civicrm-core/blob/master/contributor-key.yml

@reecebenson
Copy link
Contributor Author

@reecebenson that's for the PR - we'll see if we can get someone to give it a quick r-run & then it will be mergeable - I don't see any technical issue with the approach / your conclusions

Is this your first PR to CiviCRM? If so we'll need a second PR from you .... - adding you to our contributors file - https://github.com/civicrm/civicrm-core/blob/master/contributor-key.yml

It is indeed! I've submitted a previous PR but it was closed and someone else came up with an alternative (better) solution. I've done a second PR to add myself to the contributors here.

@eileenmcnaughton
Copy link
Contributor

Ah you should really have been added as a contributor for the closed PR too as you did contribute even if an alternate was merged - but we have to pick that sort of thing up manually

@demeritcowboy
Copy link
Contributor

I did a run. Of course I didn't look at the screenshot at first, so just noting for other people like me that this is referring to clicking on the triangle to the left of the dropdown item, as opposed to changing the dropdown item to -none-, which works both before and after. What happens though is that when you use the triangle you get this warning. And it's only when you use the triangle.

Notice: Undefined index: column in CRM_Report_Form->preProcessOrderBy() (line 4228 of /.../web/sites/all/modules/civicrm/CRM/Report/Form.php).

So I think the PR is partly fixing the problem but not fully, and at least now it's showing a separate problem which was hidden before, i.e. that the hideRow function is incomplete in some way.

I haven't tested but just looking at the dropdown I think instead of .val('') it needs to be .val('-');

@reecebenson
Copy link
Contributor Author

I did a run. Of course I didn't look at the screenshot at first, so just noting for other people like me that this is referring to clicking on the triangle to the left of the dropdown item, as opposed to changing the dropdown item to -none-, which works both before and after. What happens though is that when you use the triangle you get this warning. And it's only when you use the triangle.

Notice: Undefined index: column in CRM_Report_Form->preProcessOrderBy() (line 4228 of /.../web/sites/all/modules/civicrm/CRM/Report/Form.php).

So I think the PR is partly fixing the problem but not fully, and at least now it's showing a separate problem which was hidden before, i.e. that the hideRow function is incomplete in some way.

I haven't tested but just looking at the dropdown I think instead of .val('') it needs to be .val('-');

Hi @demeritcowboy,

I was able to reproduce the same, but believe this disappears once using the value of "-" as you've suggested. I've updated the PR to reflect, would you mind testing again?

Cheers,
Reece

@demeritcowboy
Copy link
Contributor

Looks good. Thanks @reecebenson

@eileenmcnaughton
Copy link
Contributor

Merging based on @demeritcowboy review

@eileenmcnaughton eileenmcnaughton merged commit ed2090f into civicrm:master Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants