Can't select more than one checkbox at a time

Created on 9 March 2022, about 3 years ago
Updated 11 April 2022, about 3 years ago

Problem/Motivation

- Facet of taxonomy terms, block placed on search api page
- unable to select multiple checkboxes from the facet block
- facet block adds disabled class and prevents the user from selecting a second option unless you reset the search

Steps to reproduce

- create facet of taxonomy terms, rendered as checkboxes
- add block to block layout
- choose a view inclusion option and display the block on a search api view page
- select a checkbox
- try to select a second checkbox

Proposed resolution

- remove disabled classes and script?
- add option in facet settings to choose radio buttons or checkboxes (checkboxes are always multiple unlike radio which is one)

πŸ’¬ Support request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States shevrinr

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.

  • πŸ‡ΏπŸ‡¦South Africa argh911

    Try disable caching on your view and see if that helps.

  • πŸ‡§πŸ‡ΎBelarus VasiliyRepin Minsk

    @mkalkbrenner Thank you a lot!
    In my case unchecking "Ensure that only one result can be displayed" option solved my problem!

  • πŸ‡ΊπŸ‡ΈUnited States Chad Ketchum

    I created a patch to resolve the deprecated Request::get() usage and missing session assignment for D11 compatibility.
    The 2 issues addressed in the patch are

    1. Symfony Request::get() (deprecated scalar handling).
    2. Session not set on sub-request (required in Symfony 6 / D11).

    This resolved my issue in Drupal 11 PHP 8.3, where only one checkbox per facet could be used until you refreshed the page. The Specific errors were.

    • An AJAX HTTP error occurred.
      HTTP Result Code: 500
      Debugging information follows.
      Path: /facets-block-ajax?_wrapper_format=drupal_ajax
      StatusText: Internal Server Error
      ResponseText: The website encountered an unexpected error. Try again later.
      InvalidArgumentException: Expected a scalar value as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::get()", "array" given. in Symfony\Component\HttpFoundation\InputBag->get() (line 32 of vendor/symfony/http-foundation/InputBag.php).
      Drupal\facets\Controller\FacetBlockAjaxController->ajaxFacetBlockView(Object)
      call_user_func_array(Array, Array) (Line: 123)
    • Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Session has not been set.
      in Symfony\Component\HttpKernel\HttpKernel->handle() (line 83 of /vendor/symfony/http-kernel/HttpKernel.php)
    • Uncaught Drupal.AjaxError {
      message: "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 500\nDebugging information follows.\nPath: /facets-block-ajax\nStatusText: Internal Server Error\nResponseText: The website encountered an unexpected error. Try again later.InvalidArgumentException: Expected a scalar value as a 2nd argument to \"Symfony\\Component\\HttpFoundation\\InputBag::get()\", \"array\" given. in Symfony\\Component\\HttpFoundation\\InputBag->get() (line 32 of vendor/symfony/http-foundation/InputBag.php).",
      name: "AjaxError",
      stack: "Error at core/misc/ajax.js"
      }
Production build 0.71.5 2024