Problem/Motivation

After installing module views_block_filter_block each view rendered with exposed form even if no exposed filters available. I see just Apply button without any filter field. To prevent it i should set Exposed form in block:Yes as workaround, but it is not real solution.

Proposed resolution

As i could see in src/Plugin/views/vbfbPluginDisplayBlock.php there is overridden method

public function usesExposed() {
return TRUE;
}

It forces to render exposed form even if no exposed filters used.
Probably it should check
if (!isset($this->has_exposed)) {
....
}

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

denis_kv created an issue. See original summary.

denis_kv’s picture

andriyun’s picture

Status: Active » Needs review
denis_kv’s picture

Issue summary: View changes
andypost’s picture

I think state should not be cached in plugin

andypost’s picture

Status: Needs review » Needs work

I think module should add option to configure path (user entered or current page) also it should take into account that core uses "linked display" to provide path so block has exposed form

ndeet’s picture

Hi,

thanks the patch works to only expose forms which are actually configured.

Agree with andypost, an option to specify if the view path or current page would be nice too, probably another issue. I solved it now by altering the form (hook_form_views_exposed_form_alter()) and setting the action to the page manager page containing the views block.

renukakulkarni’s picture

Priority: Normal » Major
gajanannehul’s picture

Status: Needs work » Needs review

#2 works for me.

hamrant’s picture

More simple solution

jover’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm patch #10 works.

csedax90’s picture

#10 works like a charm

CulacovPavel’s picture

Patch number #2 is more perfect. confirm patch #2

yogeshmpawar’s picture

Patch #10 working for me as well. Simple & Straight.

  • Yogesh Pawar committed 43073be on 8.x-1.x authored by hamrant
    Issue #2790505 by denis_kv, hamrant, Yogesh Pawar: Empty exposed forms...
yogeshmpawar’s picture

Status: Reviewed & tested by the community » Fixed

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

arosboro’s picture

I don't know what you guys are testing with, but patch #10 hides all views results. Negating $this->options['exposed_block'] returns the results in the view. I was using patch #2 before this was committed and was happy with it. Simpler isn't always better.

The last 2 commits related to usesExposed() absolutely stopped me in my tracks while I was working on a project.

arosboro’s picture

just frustrated, sorry if I came off as being crass. Have a great day whatever you do.

yogeshmpawar’s picture

Status: Fixed » Needs review
FileSize
881 bytes

@arosboro - Thanks for the immediate reply, Here's the updated patch will solve all the issues related to issue.
Also the AJAX Issue is solved in this patch.

  • Yogesh Pawar committed 2c65ce2 on 8.x-1.x
    Issue #2790505 by denis_kv, Yogesh Pawar, hamrant, andypost, arosboro,...
yogeshmpawar’s picture

Status: Needs review » Fixed

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

arosboro’s picture

I appreciate the quick response. I will test the latest dev branch on my project to ensure views behaves as advertised.

arosboro’s picture

@Yogesh Pawar This last commit 2c65ce2 resolves the issue I had experienced in the past two updates. Thank you!

yogeshmpawar’s picture

@arosboro - Thanks to you also for pointing this issue.

Status: Fixed » Closed (fixed)

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