Remove `category` from `Component` config entities, add `ComponentSourceInterface::determineDefaultFolder()` instead

Created on 1 October 2025, 8 days ago

Overview

As explained in detail in this MR comment on 📌 Disable components by default sourced from block plugins provided by core in the Standard profile Active , the use and importance of category has almost completely evaporated since its introduction in 📌 Define built-in components and categorization for components Postponed .

It used to have an impact even on the UI, but first 🌱 [META] Library organization with folders Active and later 📌 Disable components by default sourced from block plugins provided by core in the Standard profile Active made it have zero (direct) effect.

Proposed resolution

We should:

  1. Delete category from the Component config entity.
  2. Delete Component(Interface)::getCategory()
  3. Add ComponentSourceInterface::determineDefaultFolder()

because there's only 2 times ::getCategory() is called:

  1. \Drupal\canvas\Entity\Component::postSave(), to place the updated Component in the appropriate Folder, if any
  2. \Drupal\canvas\Entity\Component::preDelete(), to remove the deleted Component from its Folder, if any.

(That second call is AFAICT even wrong, because the user could've moved it to a different Folder!)

So, really, only 1 actual usage. And it's happening whenever the Component is created or updated, i.e. when something in the source has changed. So … then it makes much more sense to have this information NOT be stored in Component config entities at all times, and just computed/retrieved by the ComponentSource plugin on the rare occassions that it is necessary.

User interface changes

📌 Task
Status

Active

Version

1.0

Component

Config management

Created by

🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺

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.

No activities found.

Production build 0.71.5 2024