Don't display disabled block categories and items

Created on 26 September 2022, about 2 years ago
Updated 26 March 2023, over 1 year ago

Problem/Motivation

The list of Layout Builder Browser block items, organized by block category, currently displays all items and categories, even if they are disabled in their configuration.

Steps to reproduce

  • Change status: true to status: false in a layout_builder_browser_block or layout_builder_browser_blockcat configuration definition
  • View the list of Layout Builder Browser block items on a Layout Builder page
  • Note that each disabled block item or category is displayed and is selectable

Proposed resolution

Only display Layout Builder Browser block items and categories that are enabled. Ideally, we'd also expose an "Enabled" field, so this setting could be changed in the UI, but that can be added as a followup issue.

Remaining tasks

  1. Review merge request
  2. Merge issue branch

User interface changes

Disabled Layout Builder Browser block items and categories will no longer be displayed or selectable.

API changes

None

Data model changes

None

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rlhawk Seattle, Washington, United States

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 States rlhawk Seattle, Washington, United States

    Here's a patch that reflects the current state of the merge request, with fields to set the status on the block and category forms.

  • Status changed to Fixed over 1 year ago
  • πŸ‡«πŸ‡·France vbouchet

    Thanks @rlhwk for the patch and @yonailo for the useful addition.

    I slightly adapted the patch:
    - Instead of doing the filtering in the foreach loops, I simply updated the ->loadMultiple() queries to use ->loadByProperties(['status' => TRUE]); instead.
    - I added the status (Enabled/Disabled) as columns in the block and categories list so people don't need to check the Edit form to get the status.

    I will create a follow-up task to have Enable / Disable link in the operation links.

  • πŸ‡ΊπŸ‡ΈUnited States rlhawk Seattle, Washington, United States

    Wonderful, thanks!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024