Problem/Motivation
CategorizingPluginManagerInterface has changed in Drupal 12:
https://git.drupalcode.org/project/drupal/-/commit/1e719791c181ab2d50e6b...
- public function getSortedDefinitions(?array $definitions = NULL): array {
+ public function getSortedDefinitions(?array $definitions = NULL, string $label_key = 'label'): array {
$definitions = $definitions ?? $this->getDefinitions();
- public function getGroupedDefinitions(?array $definitions = NULL): array {
+ public function getGroupedDefinitions(?array $definitions = NULL, string $label_key = 'label'): array {
Proposed resolution
Can we be compatible with Drupal 12 whil staying compatible with Drupal 11 ? And Drupal 10 ? There is still 2 Drupal 10 for every Drupal 11: https://new.drupal.org/project/usage/drupal
For information, Core is already implementing CategorizingPluginManagerInterface since Drupal 11.2 (#3474533: ComponentPluginManager must implement CategorizingPluginManagerInterface) so our implementation is needed only for Drupal 10.
Comments
Comment #2
pdureau commentedWe can get inspiration from #3592808: Update getSortedDefinitions and getGroupedDefinitions signatures
It works for 11.3, 11.4, and 12. We need to test for Drupal 10.
For information, Drupal 10 compatibility will be dropped in UI Patterns 2.1. See #3471454: Drop Drupal 10 compatibility
Comment #3
grimreaperComment #4
grimreaperAs the ComponentPluginManager is using CategorizingPluginManagerTrait without overriding the getSortedDefinitions and getGroupedDefinitions methods, I think there is nothing to do.
Or have you encountered a bug already in D12?
PS: Other commits
https://git.drupalcode.org/project/drupal/-/commit/13d18b6bd928ec64c0119...
https://git.drupalcode.org/project/drupal/-/commit/3c7b7654433706a36c5ff...
Comment #6
mildertechnologies commentedHi @pdureau and @grimreaper,
I am completely new to contributing to Drupal and looking for an issue to work on! I saw this was tagged as a "Novice" issue, which is exactly what I am looking for.
However, I noticed the recent discussion about whether the ComponentPluginManage is already handling this and if there is actually anything left to do for Drupal 12. Before I try to dive in, could you clarify if this issue still needs work?
If it does, @pdureau mentioned earlier that we need to test the implementation for Drupal 10. Since I am a total newbie, would you be able to provide a few pointers on how I can test this locally, or point me toward the specific files I should look at? I am very eager to learn and would love to help out if this task is still active!
Thanks!
Comment #7
pdureau commentedHi Sumit,
Thanks for reaching out and welcome to the contrib community. Looking for "Novice" tag is a good move. It is even better to pick unassigned ticket to be sure nobody is currently working on it. This one ticket was assigned to me, but I am happy unassign me so you can have a try.
Indeed, this ticket must first be tested with this branch:
By simplify running the ComponentPluginManager, so
drush crmay be enough. But it is even better to installui_suite_libraryand to go to/admin/appearance/ui/componentsto try (you need to have at least one SDC available, Core's claro theme provides one).If it works well, there is nothing to do and you can move the ticket to "Needs review" status and unassigned you.
If KO, you can document it here, move the ticket to "Needs work" status and keep it assigned to you. We will decide a change and test it on 4 different Drupal branches:
Comment #8
grimreaperComment #10
grimreaperAs the CategorizingPluginManagerTrait is already providing methods with the $label_key arguments and as UIP component plugin manager does not implement by itself the CategorizingPluginManagerInterface, there is nothing to do.
I have added a comment for Drupal <11.2 because I was tempted to remove the
use CategorizingPluginManagerTrait;but it is not present before Core 11.2.0 so still needed for those versions.Comment #12
grimreaper