Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Clicking on the "Expose this filter to visitors, to allow them to change it" immediately after adding a filter to a view results in returning to the list of things to that can be filtered rather than loading the exposed filter options form.
- Steps to reproduce (with standard profile and javascript enabled in the browser):
- Goto to admin/structure/views/view/user_admin_people
- Click on the add button next to "Filter criteria"
- Check any filter eg. "File Usage: Entity ID" and click "Add and configure filter criteria"
- Click on the "Expose this filter to visitors, to allow them to change it" checkbox
results in the unexpected behaviour
Comment | File | Size | Author |
---|---|---|---|
#8 | 2356259-8.patch | 9.77 KB | olli |
#6 | interdiff.txt | 778 bytes | olli |
#6 | 2356259-6.patch | 4.78 KB | olli |
#4 | interdiff.txt | 1.29 KB | olli |
#4 | 2356259-4.patch | 4.02 KB | olli |
Comments
Comment #1
alexpottAfter adding the filter the form action is still set to
/admin/structure/views/ajax/add-handler/user_admin_people/page_1/filter
. I think what should happen is that the form action should be set to/admin/structure/views/ajax/handler/user_admin_people/page_1/filter/FILTER_ID
and then it work just fine. But this might not work - since you can add more than one filter at once.Comment #2
olli CreditAttribution: olli commentedThis seems to fix it.
Comment #3
Khetam CreditAttribution: Khetam commentedI am using drupal 8.0.0-beta2 version and It's working fine with me :) :) :)
Thanks,
Khetam.
Comment #4
olli CreditAttribution: olli commentedSame problem with sort criteria.
Comment #5
vijaycs85thanks for the patch @olli. Would be great to have a test-only failing patch.
One minor comment:
Mousedown? why not leave it as click? if we have to, then the handler name should be changed as well.
Comment #6
olli CreditAttribution: olli commentedSame problem with the "Remove" button when adding a filter.
I agree, but not sure how.
Using click makes the ajax trigger when you hit enter, see comments in RenderElement::preRenderAjaxForm(). This happens in HEAD currently.
Drupal.viewsUi.Checkboxifier.prototype.clickHandler? That's for the checkbox, not the button.
Now I see that this changes nearly all of #2130205: Unable to "Expose this filter to visitors, to allow them to change it"... It looks like d7 views ui makes these ajax buttons work via javascript but that code has been removed from d8.
Comment #7
olli CreditAttribution: olli commentedIt would be nice to move this fix up to ViewsFormBase or somewhere.
Comment #8
olli CreditAttribution: olli commentedHere's another patch that is about how d7 views ui seems to work.
Comment #9
metzlerd CreditAttribution: metzlerd as a volunteer and commentedDuplicate of #2248223: Adding a new Views filter and making it exposed returns user back to list of filters. If appropriate it would probably good to file patches there.