Duplicate keywords field in views exposed form

Created on 18 March 2022, over 2 years ago
Updated 17 October 2023, 8 months ago

Problem/Motivation

  • When I create a view to be a basic Content Search page with a keyword search field, the keyword search textbox is duplicated. See attached screenshot
  • The textboxes both have the same HTML ID.
  • This also causes duplicate search query parameters, giving a submit URL like /test?q=&q=test (when submitting with "test" in the 2nd search box).
  • No results show, regardless of whether I fill in one or both boxes with my keywords
  • However, results DO show when using the View preview when editing the view, so I know my content is indexed correctly and that it all should work...
  • Because of the above, I also tried changing the view to submit the exposed form with AJAX, that didn't work either.

Steps to reproduce

  1. Install and enable Search API (dev branch), Database Search, Views, Views UI, Text
  2. Create a node with a body and title
  3. Create a Search API server (I used the Local Database type)
  4. Create a Search API Content index, then index all nodes
  5. Create a Content index View with a Page display and an exposed "Search: Fulltext Search" filter

See attached YAML config files.

Proposed resolution

The duplicate field should be removed.

Remaining tasks

Figure out what causes the issue.

πŸ› Bug report
Status

Closed: works as designed

Version

1.0

Component

User interface

Created by

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

Comments & Activities

Not all content is available!

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

  • We're also seeing this on our site. only occurs with 'q' as the query filter identifier

  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡¦πŸ‡ΉAustria drunken monkey Vienna, Austria

    Thanks for reporting this problem, and sorry it took me so long to get back to you!
    However, this is a very standard setup of the Search API, and I cannot believe that this generally doesn’t work. It would, especially if searches fail, also lead to fails in our automated tests.
    Does this still happen for you with the latest Drupal and module versions? Does it also happen with a new site, without any other (non-Core) modules installed? If not, any idea which of your modules (or theme?) could be interfering?

  • Status changed to Active about 1 year ago
  • I can confirm, though as @sbrenner02 said, it only happens when the search index filter field's "Filter identifier" is set to q

    Just tested on a fresh D10 install with no contrib.

  • Status changed to Closed: works as designed 8 months ago
  • "q" is a reserved query parameter.

Production build 0.69.0 2024