Fixed
Project:
Drupal core
Version:
11.x-dev
Component:
extension system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2026 at 02:54 UTC
Updated:
20 Jul 2026 at 08:32 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nicxvan commentedComment #4
nicxvan commentedThis is ready for review.
Comment #5
smustgrave commentedDid a search for:
module_set_weight: all references replaced
module_config_sort: all references replaced
Since this was 2 wonder if it would of been disruptive to remove in 12? But will defer to your judgement.
LGTM
Comment #6
nicxvan commentedComment #7
nicxvan commentedAdding 11.5.0 release priority since it would be great to get this in there too.
Comment #8
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #9
claudiu.cristeaWouldn't be more appropriate to add the methods to module handler instead of a new service?
Comment #10
nicxvan commentedNo, moduleHandler already does a lot, and most of the places using miduleweight and sort don't already have moduleHandler injected, so we might as well keep it lightweight.
Still needs a rebase.
Comment #11
nicxvan commentedRebased
Comment #12
claudiu.cristeaComment #13
claudiu.cristeaA lot is already happening in
There is also #1808132: Move module_set_weight() into ModuleHandler::setWeight(), add ModuleHandler::getWeight() to replace missing functionality which has been closed in favor of the above.
I think we need to align. Maybe close this or the others. No idea for the moment...
Comment #14
nicxvan commentedI think it's worth doing these together, if this gets in we can close the others and provide credit there.
I took them into account, I think we need to keep weight for now even if we want to get rid of it someday since it's the only way to globally order hooks for a module.
Comment #15
smustgrave commentedRestoring status from bot kicking back for rebase.
Should any of the other issues be closed and credit moved over? Happy to do that.
Comment #16
nicxvan commentedAll closed issues can grant credit so I'll take care of the other ones when this lands.
Comment #17
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #18
nicxvan commentedRebased, the conflict was the auto uninstall profile issue moved the profile weight into an if.
Comment #20
catchI had a look at #3262807: Deprecate module_config_sort(), it adds a generic sorting method which is then used by the module handler. I'm not sure we should add that, because we actually want to deprecate module weights, and then there'd be no usages in core. I think we should potentially repurpose that one for 'add a generic method that sorts by keys and values' though. But for me this means the approach of just moving the logic as in this issue makes sense.
#2968232: Deprecate module_set_weight() is about deprecating module weights, not the method, and should stay open.
Committed/pushed to main, thanks!
Will need a backport MR for 11.x
Comment #23
nicxvan commentedThere were three conflicts, none of them complex:
ModuleInstaller, main has removed the uninstall validator so we had to manually add the ModuleWeight argument back and make it nullable explicitly.
Content translation lines changed so the replacement of the set weight call had to be redone, and the use statement had to be readded to the installer config directory test base.
Comment #25
longwaveBackport looks correct to me.
Committed and pushed daf0e8e3a1e to 11.x. Thanks!