Views blocks that are disabled should not appear in block UI/layout builder

Created on 21 August 2019, over 5 years ago
Updated 5 March 2024, 10 months ago

Problem/Motivation

Disbled block type displays of views appears in block UI/layout builder adding list.

Steps to reproduce

  1. Create a standard D11 installation
  2. Go to Content view edit page (admin/structure/views/view/content)
  3. Add a Block type display to the view and rename it "Test block"
  4. In the view edit page disable the block by cliking "Disable Test block" link
  5. Save the view
  6. Go to Claro's Block layout page (admin/structure/block/list/claro)
  7. Click on "Place block" button for any region
  8. Our disabled block, "Test block", appears in the list

Proposed resolution

Hide disabled view blocks from the block adding list.

Merge request link

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Views 

Last updated about 2 hours ago

Created by

🇺🇸United States bkosborne New Jersey, USA

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • First commit to issue fork.
  • Pipeline finished with Success
    11 months ago
    #81339
  • Status changed to Needs review 11 months ago
  • 🇮🇳India sijumpk

    Updated in such a way that the disabled blocks wont appear on add new block UI/layout, but existing added blocks will appear as such in UI.

  • Assigned to divya.sejekan
  • 🇮🇳India divya.sejekan

    @sijumpk I tried With the MR !6287 - 11.x and also 3076346-views-blocks-that
    The issue is not resolved.

    Testing steps :
    1. Add a block , and individual blocks
    2. disabled individual block
    3. This block still appears in block UI or layout builder.

  • Issue was unassigned.
  • Status changed to Needs work 11 months ago
  • Status changed to Needs review 11 months ago
  • 🇮🇳India sijumpk

    @divya.sejekan, In order to see the updated list after disabling the block, you should reloaded blocks UI page or reopened the "Place block" popup after closing it.

  • Status changed to Needs work 11 months ago
  • 🇺🇸United States smustgrave

    This will need a failing test to show the issue.

    Issue summary also needs to be updated to use the standard issue template.

    Did not test.

  • Pipeline finished with Success
    11 months ago
    Total: 580s
    #82969
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MariaDB 10.3.22
    last update 11 months ago
    Build Successful
  • Added standard template and updated issue summary.
    Thanks

  • Status changed to Needs review 11 months ago
  • Status changed to Needs work 11 months ago
  • 🇺🇸United States smustgrave

    Have not reviewed. Still appears to need an issue summary update. No need to add a failing patch, there's the test-only feature of the MR.

  • 🇮🇳India sijumpk

    Problem/Motivation

    Disbled block type displays of views appears in block UI/layout builder adding list.

    Steps to reproduce

    1. Create a standard D11 installation
    2. Go to Content view edit page (admin/structure/views/view/content)
    3. Add a Block type display to the view and rename it "Test block"
    4. In the view edit page disable the block by cliking "Disable Test block" link
    5. Save the view
    6. Go to Claro's Block layout page (admin/structure/block/list/claro)
    7. Click on "Place block" button for any region
    8. Our disabled block, "Test block", appears in the list

    Proposed resolution

    Hide disabled view blocks from the block adding list.

    Merge request link

    Remaining tasks

    User interface changes

    API changes

    Data model changes

    Release notes snippet

  • Status changed to Needs review 11 months ago
  • Status changed to Needs work 11 months ago
  • 🇺🇸United States smustgrave

    Running the test-only feature though shows the test is passing without the fix. https://git.drupalcode.org/issue/drupal-3076346/-/jobs/697927

  • Pipeline finished with Canceled
    11 months ago
    Total: 8s
    #89299
  • Pipeline finished with Failed
    11 months ago
    Total: 514s
    #89300
  • Status changed to Needs review 11 months ago
  • 🇮🇳India sijumpk

    The error fixing portion is reverted back, and now there is just the test in the current MR. You can see that its getting failed with the desired error message. https://git.drupalcode.org/issue/drupal-3076346/-/jobs/762582.

    So technically the test-only feature should also have to fail. How can this be possible? I also did a rebasing this time, maybe that helped. Anyway if you can check the current failed MR and confirm about the test case, I will add back the fix to the MR.

  • Pipeline finished with Canceled
    10 months ago
    Total: 10s
    #90128
  • Pipeline finished with Success
    10 months ago
    Total: 543s
    #90129
  • 🇮🇳India sijumpk

    Tried removing the problem fixing portion from the code, leaving test only in MR. By doing so the MR got failed with the desired error message. You can see the job results here

    https://git.drupalcode.org/issue/drupal-3076346/-/jobs/762582

    Now the fix is added back to the code, and MR is getting completed without errors. No idea how the test-only pipeline got passed last time. Now I have rebased the code also, so this time lets hope test-only will work as expected.

  • Status changed to Needs work 10 months ago
  • 🇮🇳India djsagar

    Hi All,

    After MR !6287, The test block hide from Place block option,
    But i also tested the issue by following Steps

    1. Create a standard D11 installation
    2. Go to Content view edit page (admin/structure/views/view/content)
    3. Add a Block type display to the view and rename it "Test block"
    4. In the view edit page disable the block by cliking "Disable Test block" link
    5. Save the view
    6. Go to Claro's Block layout page (admin/structure/block/list/claro)
    7. Click on "Place block" button for any region
    8. Our disabled block, "Test block", appears in the list

    User can place the block after disable block in view, but block not appears in any page. maybe i miss some step.

  • 🇮🇳India sijumpk

    sijumpk changed the visibility of the branch 3076346-views-blocks-that to hidden.

  • Pipeline finished with Canceled
    10 months ago
    Total: 49s
    #93984
  • 🇮🇳India sijumpk

    sijumpk changed the visibility of the branch 11.x to hidden.

  • Pipeline finished with Success
    10 months ago
    Total: 665s
    #93973
  • Pipeline finished with Success
    10 months ago
    Total: 707s
    #93987
  • Status changed to Needs review 10 months ago
  • 🇮🇳India sijumpk

    Had committed the problem fixing code to 11.x branch, because of that the test-only pipeline was not showing any problem. Now 11.x is reverted back to its original state and added changes (the fix and updated test) to a separate branch. Here is the test result for test-only pipeline https://git.drupalcode.org/issue/drupal-3076346/-/jobs/806000. And its getting failed as expected. Please review it.

  • Status changed to Needs work 10 months ago
  • 🇺🇸United States smustgrave

    Sorry re-read the title and just realized this was also mentioning layout builder. Think we need to add test coverage there as well. Maybe can extend existing to check the list but in layout builder.

    That test should be in layout builder module though.

  • Pipeline finished with Canceled
    10 months ago
    Total: 531s
    #102289
  • Pipeline finished with Failed
    10 months ago
    Total: 483s
    #102305
  • Pipeline finished with Success
    10 months ago
    Total: 487s
    #102353
  • Status changed to Needs review 10 months ago
  • 🇮🇳India sijumpk

    @smustgrave, it was a point worth watching. I missed that portion and Layout builder is using its own logic to list the blocks. Now its fixed and also a test case for that added to an existing test file.

  • Status changed to RTBC 10 months ago
  • 🇺🇸United States smustgrave

    Believe this covers both scenarios now

  • Pipeline finished with Success
    10 months ago
    Total: 670s
    #102700
  • Status changed to Needs work 10 months ago
  • 🇬🇧United Kingdom catch

    Left feedback on the MR.

Production build 0.71.5 2024