The views_plugin_display_block class is set to use exposed only if ajax is on, but this module doesn't need that. Let's remove the dependency!

Comments

drclaw’s picture

Issue summary: View changes
StatusFileSize
new452 bytes

Attached patch removes ths ajax dependency.

drclaw’s picture

Status: Active » Needs review

Needs review :)

drclaw’s picture

StatusFileSize
new611 bytes

Last patch actually exposes the form on all blocks. Oops! Here's one that only exposes it for blocks with AJAX on, or if the exposed form is exposed as a block.

iamEAP’s picture

Thanks for the patch @drclaw! Tested this on simplytest.me and works as promised. I'll do a code review soon...

drclaw’s picture

StatusFileSize
new619 bytes

Hi, thanks for testing it out! While we're on the subject, here's an updated one with a slightly less error prone check for the exposed form setting (I noticed a bunch of "undefined index" errors in my logs recently).

Thanks!

paulihuhtiniemi’s picture

StatusFileSize
new598 bytes

Maybe I'm missing something, but shouldn't it be only for Views that have filters exposed as blocks?

bart vanhoutte’s picture

Status: Needs review » Reviewed & tested by the community

Tested #6, looks good.

drclaw’s picture

StatusFileSize
new650 bytes

@paulihuhtiniem I think we need to keep the use_ajax() check in there. This module actually replaces the the original views block plugin so we need to keep the original functionality intact in addition to our exposed as block check. If not, the filters won't appear on view blocks that have exposed filters that aren't exposed as a block.

And now that I think about it, I think we should probably call the views_plugin_display class's uses_exposed() method instead of just returning TRUE since not all blocks with AJAX turned on will have exposed filters (in the case of only having a pager for example). Patch attached!

drclaw’s picture

Status: Reviewed & tested by the community » Needs review
bart vanhoutte’s picture

Status: Needs review » Reviewed & tested by the community

#8 is right, tested and works.

  • iamEAP committed 227d627 on 7.x-1.x authored by drclaw
    Issue #2162479 by drclaw, paulihuhtiniemi: Remove dependency on block...
iamEAP’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Thanks everyone! Tried it out myself on simplytest.me and it works as expected.

Moving to 8.x so that it gets applied.

yogeshmpawar’s picture

StatusFileSize
new613 bytes

Here's the patch for 8.x-1.x branch.

  • Yogesh Pawar committed 06b0844 on 8.x-1.x
    Issue #2162479 by drclaw, paulihuhtiniemi, Yogesh Pawar: Remove...
yogeshmpawar’s picture

Status: Patch (to be ported) » Fixed

Committed & pushed to 8.x-1.x branch also assigning credits.

arosboro’s picture

Status: Fixed » Needs work

The patch in #13, applied with 06b08442edc4, had me scratching my head. It doesn't include a ! (NOT) operator, so all views without AJAX enabled break.

yogeshmpawar’s picture

Status: Needs work » Fixed

@arosboro - Marking this issue as Fixed because this issue is solved Empty exposed forms appeared issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.