Problem/Motivation
From #2659940-119: Extension System, Part III: ThemeExtensionList and ThemeEngineExtensionList:
Starting to feel like these might need to be tagged services with a collector to clear them all in one go? That would be the path to deprecating system_list_reset right? Follow up?
Currently, there is no easy way for code to request all extension listing services. This leads to bloated and hardcoded functions in core that repeatedly list out all known extension listing services (module, theme, theme_engine, profile).
It also leads to bloated and hard to maintain code in contrib modules that need to support additional features, such as added YAML library config or module config.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork drupal-2973439
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
dawehnerComment #13
andypostPart of it done in #1685492: Convert theme engines into services
Comment #14
andypostComment #17
longwaveUnsure if or how to provide BC in the constructor here, but I also don't see why anyone would override this. This issue helps unblock #1685492: Convert theme engines into services where the theme engine list will be deprecated.
Not actually sure these are all cleared anywhere any more, we could add something to the resolver to clear them if necessary but it feels like the wrong place.
Comment #18
nicxvan commentedDo you mean where reset is called? https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
I was actually looking into that a couple of weeks ago when I thought I needed to reset themes.
Let me look again iirc it was called somewhere for modules but not the other extension lists.
Maybe like this: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
And here: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
And here:
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...
Comment #19
longwaveYeah it's not clear in many cases if we should be resetting one, some, or all. Not sure if we need to mess with any of that here though, if there are no known bugs; in practice the lists do not change often.
Comment #20
nicxvan commentedI think this is good, but there are a few open questions for me that I'm trying to answer.
1. Were Database extensions intentionally left out? I know they are super weird and always there like theme engines and I know a lot of the list service is intentionally not implemented. I might ping @daffie and @mondrake just to confirm.
2. BC, I tend to agree, nothing we can do without just wholesale deprecation and replacement which I don't think serves any purpose.
I found where it was implemented: #3256642: Introduce database driver extensions and autoload database drivers' dependencies and there is no mention of the path resolver so I think it was just an oversight rather than intentional.
So for 1, I will ping them, for 2 I will ask for other opinions in slack too.
Comment #21
mondrake@nixvan as far as I remember, the db driver related implementation was just the minimum necessary to fill the needs of listing them as extensions in the install process. So yes, all what was not necessary was intentionally left out, if that's what you mean.
Comment #22
nicxvan commentedThanks @mondrake! That solves concern 1.
I have two minor doc updates as MR suggestions.
I think there is nothing to do for BC here. Once we get those two comments applied I can RTBC I think.
Does this need a CR? Technically it's a BC break, but I don't think it will be for most people using it.
Comment #23
longwaveFixed up the docs, removed database drivers for now, and I wrote a basic change record at https://www.drupal.org/node/3549907
Comment #24
nicxvan commentedCR and changes look good, only open question is if there is a way to do this and preserve BC. I think this is fine as is though.
Comment #25
alexpottAre we sure that we want to do this? This feels like we creating way to extend extension listing. I think the issue summary needs an update to explain the motivation amongst other things.
Comment #26
nicxvan commentedCopied from a duplicate to the issue summary.
Comment #27
nicxvan commentedComment #29
dcam commentedSo, the change to
ExtensionPathResolveris just to verify the service tag works, right? It would be nice to have that in the proposed resolution section of the issue summary.Here's your BC example:
My limited testing showed that it worked. Basically, I reverted the change to ExtensionPathResolverTest and also added a new test function to it that requested the path for the system module. You'll probably need to workshop the deprecation message. I hope you don't mind if I set the issue to Needs Work for you to consider it. I agree that it's probably pointless, but I was so hesitant to review this without BC.