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.
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
Comment | File | Size | Author |
---|---|---|---|
#5 | views_autocomplete_filters-contextual-filters-3259438-5.patch | 5.98 KB | Jeff Cardwell |
#4 | contextual_filters-3259438-1.patch | 5.98 KB | Jeff Cardwell |
contextual_filter.patch | 5.42 KB | venugopp |
Issue fork views_autocomplete_filters-3259438
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:
Comments
Comment #2
venugopp CreditAttribution: venugopp as a volunteer and commentedComment #3
er_abhinav CreditAttribution: er_abhinav at Evolving Web commented@venugopp this patch is not working for Drupal version 9.4.9
Comment #4
Jeff Cardwell CreditAttribution: Jeff Cardwell commentedRe-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!
Comment #5
Jeff Cardwell CreditAttribution: Jeff Cardwell commentedFixing up the patch name to follow https://www.drupal.org/docs/develop/git/using-git-to-contribute-to-drupa...
Comment #6
maxilein CreditAttribution: maxilein commented#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}
Comment #7
maxilein CreditAttribution: maxilein commentedOne more info: the exposed term field is based on a view relationship
Comment #8
maxilein CreditAttribution: maxilein commentedComment #9
vasikeMoving to current branch
Comment #11
vasikeMR available ... from previous patches ... thanks.
Comment #13
vasikeAnd merged ... i think now there is a solution for contextual filters
Many thanks to @venugopp and @Jeff Cardwell.
closing - queue clean-up.