'Filter by block name' filter is not working correctly

Created on 8 September 2022, almost 2 years ago
Updated 21 March 2024, 3 months ago

Problem/Motivation

When adding block through the Layout builder, the 'Filter by block name' filter doesn't seem to find any results.
This is tested with Drupal core 9.4.5 on simplytest.me

See attached screenshots for example.

🐛 Bug report
Status

Closed: works as designed

Version

11.0 🔥

Component
Layout builder 

Last updated less than a minute ago

Created by

🇧🇬Bulgaria yivanov

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

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.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • Into D10 (10.0.7) version & just adding "$build['#type'] = 'container';" to choose block customized controlled (has no type by default, just children items, calling to parent method to get original structure) seems working correctly (seems js context "const $categories = $('.js-layout-builder-categories', context);" detect nothing, 0 length, if that selector is the first level of context). Maybe is easier to add into original controller if that works too for D9.5 version or modify js to avoid that extra tag (not checked for D9, js seems different). Scenario: layout builder lock + layout builder restrictions & customized choose block controller.

  • 🇺🇸United States drupalninja99

    I am still having this issue in D10

  • 🇺🇸United States DigitalFrontiersMedia Sarasota, FL

    @CRZDEV, Are you using the Layout Builder Modal module? If so, the context returned is different from off-canvas context and is one level lower than what is returned with off-canvas. "$('.js-layout-builder-categories', context)" returns 0 length in this situation. There could be other alters, etc. type of configurations that could result the same. I had to duplicate layout-builder.js in a custom library since Core patch in our case wasn't an easy option. The custom version used "$(context).parent()" instead of "context".

  • 🇮🇳India sahilgidwani Jaipur

    Adding patch for v10.1

  • last update 8 months ago
    Custom Commands Failed
  • 🇮🇳India _utsavsharma

    Fixed failures in #20.

  • last update 8 months ago
    30,481 pass
  • last update 8 months ago
    29,678 pass
  • @DigitalFrontiersMedia Not exactly that module but yeah, a modal provided by VLSuite, change that you suggest also has sense in that context. In any case not sure if it should work as intuition suggests, maybe it should, main context selector is also loaded by ajax.

  • 🇨🇦Canada phjou Vancouver/Paris 🇨🇦 🇪🇺

    I don't know if it is related because the "Filter by block name" seems to work on Chrome but on Firefox, I do not get any results and the feature brings the CPU usage to 100% and ultimately the browser tab ends up crashing.

  • Status changed to Postponed: needs info 4 months ago
  • 🇳🇿New Zealand DanielVeza Brisbane, AU

    Hey all,

    I've been testing this with a fresh install of D11 and the block filter is working correctly in all of my tests.

    Steps I've taken:

    1. Install fresh D11 standard site
    2. Enable LB & overrides on the article content type
    3. Create an article and go to the layout page for it
    4. Click add block
    5. Try filter by "ID", and verify the ID, Revision ID and User ID blocks are shown and all other blocks are filtered out.

    Do people have other LB modules that may be causing issues here? For example I see that Layout Builder browser has had various issues related to this over the years.

    Could we please get some steps to replicate with just Drupal core?

  • 🇧🇷Brazil carolpettirossi Campinas - SP

    I couldn't reproduce the issue on Drupal 10.2.4

    1. Created a D10 instance on simplytest.me
    2. Enabled LB & overrides on the basic page content type
    3. Created a basic page
    4. Clicked on Layout tab
    5. Click to "add block"
    6. Try filter by an invalid block name and then fix the typo

    Result: working as expected listing the available blocks.

  • Status changed to Closed: works as designed 4 months ago
  • 🇧🇷Brazil cassioalmeida

    Based on the last comments, it seems this is not related to Layout Builder but a combination of it with other modules, such as Layout Builder Modal.

    If this is the case, I'd recommend closing this issue.

  • 🇺🇦Ukraine r_cheh

    The layout builder block search wasn't working because of front theme on the layout edit page, the solution was found - the script tried to hide the parent element of the link but we needed to hide just the links. For me it works, maybe it also will be useful for someone.

Production build 0.69.0 2024