Not working with contextual filters

Created on 19 January 2022, almost 3 years ago
Updated 27 March 2024, 8 months ago

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

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India venugopp Bangalore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States Jeff Cardwell

    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!

  • 🇦🇹Austria maxilein

    #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}

  • 🇦🇹Austria maxilein

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

  • Status changed to Needs work over 1 year ago
  • 🇷🇴Romania vasike Ramnicu Valcea

    Moving to current branch

  • Status changed to Needs review 8 months ago
  • 🇷🇴Romania vasike Ramnicu Valcea

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

    • vasike committed f5588bc7 on 2.0.x
      Issue #3259438 by Jeff Cardwell, venugopp, vasike: Allow contextual...
  • Status changed to Fixed 8 months ago
  • 🇷🇴Romania vasike Ramnicu Valcea

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

    closing - queue clean-up.

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

Production build 0.71.5 2024