- π¬π§United Kingdom Rob230
Can someone explain to me how you can control the order of hooks when two modules both implement
hook_module_implements_alter()
? I have tried making one module a dependency of the other but it didn't help. It seems the only thing I can do is to set the weight of my module to ensure myhook_module_implements_alter()
runs before the other module'shook_module_implements_alter()
. - π«π·France andypost
The #7 still points to other issue to fix first - #1808132: Move module_set_weight() into ModuleHandler::setWeight(), add ModuleHandler::getWeight() to replace missing functionality β
- Status changed to Needs review
over 1 year ago 6:37am 11 May 2023 - last update
over 1 year ago Custom Commands Failed - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
- last update
over 1 year ago 29,369 pass, 3 fail - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Fixed phpstan issue.
The last submitted patch, 45: 2968232-45.patch, failed testing. View results β
- last update
over 1 year ago 29,360 pass, 3 fail - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Fix page cache tests.
The last submitted patch, 47: 2968232-47.patch, failed testing. View results β
- Status changed to Closed: works as designed
over 1 year ago 10:17am 13 June 2023 - π©πͺGermany Elin Yordanov
Once again a non-sense no value adding issue to kill a function. Why? Why the whole discussion, wasted man-hours? The suggested alternative hook_module_implements_alter is not a replacement, you cannot have control of the module weights/
Please re-read TR's comment #2968232-6: Deprecate module_set_weight() β . He listed imported use cases.
I'm not convinced that this function should be removed. I also don't see any reason. Why remove something that doesn't break anything, only to break things?
- Status changed to Needs work
over 1 year ago 10:55am 13 June 2023 - π§πͺBelgium borisson_ Mechelen, π§πͺ
I'm not convinced that this function should be removed. I also don't see any reason. Why remove something that doesn't break anything, only to break things?
It's not because you disagree with an issue that it should be closed, I mean I think it needs to be discussed still.
I agree with @alexpott and @dawehner in the initial patches here, that having an explicit weight system is not the most robust and that it would be a lot better for modules to decide what other modules they should be fired after/before as that is a lot more explicit, manually setting weights can lead to conflicts and if I understand this issue correctly, we should see if we can module weight system not have explicit numbers but rather be configured on their dependencies instead, as the research by @dawehner suggests.
Back to needs work for a reroll and to fix the remaining test fails.
- Status changed to Needs review
over 1 year ago 12:14pm 13 June 2023 - last update
over 1 year ago Custom Commands Failed - π§π·Brazil elber Brazil
Hi added a reroll using patch #2 as @borisson said. Please revise.
- last update
over 1 year ago Custom Commands Failed - Status changed to Needs work
over 1 year ago 1:28pm 13 June 2023 - πΊπΈUnited States joshf
we should see if we can module weight system not have explicit numbers but rather be configured on their dependencies instead
Is that work being done somewhere? If so, that work should block this, right? If not, this work definitely shouldn't be merged, right? Until that refactor is done,
module_set_weight()
is critical functionality with no replacement.Right? I'm not missing anything?
- Status changed to Needs review
about 1 year ago 7:06am 6 November 2023 - π·πΊRussia sorlov
Fixed issues in #53 according to https://www.drupal.org/pift-ci-job/2690801 β
- last update
about 1 year ago 30,484 pass, 2 fail - Status changed to Needs work
about 1 year ago 2:40pm 6 November 2023 - Assigned to kim.pepper
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
I took #47 and turned it into a MR. I'm going to look at some of the test fails.
- Issue was unassigned.
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
I think we need sign-off from a framework manager that we want to remove this API.
- π§π΄Bolivia vacho Cochabamba
This patch removes some another uses of the function module_set_weight
- last update
about 1 year ago 30,491 pass, 2 fail - π§π΄Bolivia vacho Cochabamba
Needds to review more in deep testing fail for d7 migration
- π³πΏNew Zealand john pitcairn
Note
hook_module_implements_alter()
will not work if you need yourhook_preprocess_HOOK()
to run after some other module's preprocess hook. Preprocess hooks are not invoked by the module handler and are not present inhook_module_implements_alter()
.So removing this API will be problematic if you have a soft dependency on another module's preprocess hook, ie the module is not a requirement, but if it is present you need to preprocess something it also preprocesses, after it has done so. You don't want to declare a hard dependency in module .info. Altering module weight is the only way this will work, right?