Provide a category for plugin block

Created on 20 February 2025, 4 months ago

Problem/Motivation

Some modules (Block field) can use the category on the plugin blocks to list and expose them as configuation. This is what does the module block_field which provide a new field type which allows to embed plugin block.

This module allows us to defini which block will be exposed, and we can enable block per block or per category.

But as our block plugin doesn't provide a category in their definition, then Core fallback to the human readable module name (See Drupal\Core\Plugin\CategorizingPluginManagerTrait::processDefinitionCategory(&$definition)), and then we get a select list with "TOC.js" as a value, and we can't save anymore the field configuration form, because dot are not allowed :

La tentative de mise Γ  jour du champ Block a Γ©chouΓ© : Toc.js key contains a dot which is not supported..

Steps to reproduce

Install block_field module
Add a block_field field type on any entity type
Configure this field, and selec the blocks to expose per category.
You can't save the form.

Proposed resolution

Add a category on the plugon block provided by Toc.js, category without a dot of course.

User interface changes

No

API changes

No

Data model changes

No

πŸ› Bug report
Status

Active

Version

3.1

Component

Code

Created by

πŸ‡«πŸ‡·France flocondetoile Lyon

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

Comments & Activities

Production build 0.71.5 2024