Problem/Motivation

Contextual filters does not get applied to get the auto suggestions

Steps to reproduce

1. Create a view with a contextual filter for a tag
2. Have an exposed filter for title
3. Load the views for any contextual filter
4. Type in the exposed filter, you see the results from other tags as well(contextual filter is not applied).

Proposed resolution

1. Add a new configuration, which can be enabled to include the contextual filter while searching with exposed filters

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

venugopp created an issue. See original summary.

venugopp’s picture

Status: Active » Needs review
er_abhinav’s picture

@venugopp this patch is not working for Drupal version 9.4.9

Jeff Cardwell’s picture

Re-rolled on 8.x-1.4

Is there further work on this issue that is needed for the maintainers to consider it for merge? Tests? Further use-case justification?

If there's some further work that I could do to get it closer to a merge, I'm interested in doing so.

Thanks!

Jeff Cardwell’s picture

maxilein’s picture

#5 does not work for me. The blue ring of the autocomplete just flashes. No dropdown gets created.
it is one filter field of multiple exposed filter fields.

Warning: Attempt to read property "value" on null in Drupal\views_autocomplete_filters\Controller\ViewsAutocompleteFiltersController->autocomplete() (line 224 of /web/modules/contrib/views_autocomplete_filters/src/Controller/ViewsAutocompleteFiltersController.php)

#0 /web/core/includes/bootstrap.inc(347): _drupal_error_handler_real()
#1 /web/modules/contrib/views_autocomplete_filters/src/Controller/ViewsAutocompleteFiltersController.php(224): _drupal_error_handler()
#2 [internal function]: Drupal\views_autocomplete_filters\Controller\ViewsAutocompleteFiltersController->autocomplete()
#3 /web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#4 /web/core/lib/Drupal/Core/Render/Renderer.php(580): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#5 /web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext()
#6 /web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#7 /web/vendor/symfony/http-kernel/HttpKernel.php(169): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#8 /web/vendor/symfony/http-kernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#9 /web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#10 /web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#11 /web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#12 /web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#13 /web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle()
#14 /web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#15 /web/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#16 /web/core/lib/Drupal/Core/DrupalKernel.php(718): Stack\StackedHttpKernel->handle()
#17 /web/index.php(19): Drupal\Core\DrupalKernel->handle()
#18 {main}

maxilein’s picture

One more info: the exposed term field is based on a view relationship

maxilein’s picture

Status: Needs review » Needs work
vasike’s picture

Version: 8.x-1.x-dev » 2.0.x-dev

Moving to current branch

vasike’s picture

Status: Needs work » Needs review

MR available ... from previous patches ... thanks.

  • vasike committed f5588bc7 on 2.0.x
    Issue #3259438 by Jeff Cardwell, venugopp, vasike: Allow contextual...
vasike’s picture

Status: Needs review » Fixed

And merged ... i think now there is a solution for contextual filters
Many thanks to @venugopp and @Jeff Cardwell.

closing - queue clean-up.

Status: Fixed » Closed (fixed)

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