Facet checkbox doesn't work with bigpipe

Created on 28 May 2022, over 2 years ago
Updated 25 July 2023, over 1 year ago

Problem/Motivation

When i enable big pipe with "advagg" or core "Aggregate JavaScript files" facets doesn't work.

Steps to reproduce

Create facets
Enable bigpipe and try facets.
Enable core "Aggregate JavaScript files" of advagg and try facets.

No bigpipe i have

<li class="facet-item">
      <input type="checkbox" class="facets-checkbox" id="product-attribute-12-catalog-solr-134">
      <label for="product-attribute-12-catalog-solr-134">
           <span class="facet-item__value">Arancione</span>
      </label>
      <a href="/it/tappeti?catalog%5B0%5D=product_attribute_12_catalog_solr%3A134" rel="nofollow" data-drupal-facet-item-id="product-attribute-12-catalog-solr-134" data-drupal-facet-item-value="134" data-drupal-facet-item-count="4" style="display: none;">
             <span class="facet-item__value">Arancione</span>
      </a>
</li>

With bigpipe i have

<li class="facet-item">
        <a href="/it/tappeti?catalog%5B0%5D=product_attribute_12_catalog_solr%3A134" rel="nofollow" data-drupal-facet-item-id="product-attribute-12-catalog-solr-134" data-drupal-facet-item-value="134" data-drupal-facet-item-count="4">
                 <span class="facet-item__value">Arancione</span>
       </a>
</li>

Bigpipe doesn't execute js.
Thank you

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇹Italy trickfun

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.

  • 🇬🇧United Kingdom astoker88

    +1 on this issue, although for me it only happens in combination with bigpipe enabled, and an authenticated user. Anonymous users work fine with bigpipe enabled.

  • 🇺🇸United States jrb Raleigh-Durham Area, NC, USA

    We were seeing something similar, too, where Facet blocks were not showing up sometimes with BigPipe enabled. It was not a problem on every page load, though. Seems like it might be due to a race condition?

    Just FYI, you can disable BigPipe for Facet blocks by adding this to a custom module:

    use Drupal\Core\Block\BlockPluginInterface;
    
    /**
     * Implements hook_block_build_BASE_BLOCK_ID_alter().
     */
    function example_block_build_facet_block_alter(array &$build, BlockPluginInterface $block) {
      // Disable BigPipe placeholder for this block.
      $build['#create_placeholder'] = FALSE;
    }
    
Production build 0.71.5 2024