Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
other
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Aug 2013 at 08:14 UTC
Updated:
29 Jul 2014 at 22:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alexpottAdding patch from #2045923: Replace all module_invoke_all() deprecated function calls in procedural code. as a starting point... this just replaces calls to module_invoke_all with \Drupal::moduleHandler() which is not the right approach.
Comment #2
benjy commentedDo we think this might be better broken up into smaller bite size chunks?
Comment #3
sunComment #4
internetdevels commentedRerolled patch attached.
Comment #6
xanoRe-roll.
Comment #8
xanoComment #9
ianthomas_ukThis is OO code, so it should be using a module_handler object directly, rather than via \Drupal()
Comment #10
xanoWe'll deal with dependency injection in different issues. This is just about removing the procedural wrappers, and facilitating PHPUnit tests by making code depend on auto-loadable code.
Comment #11
ianthomas_ukFair enough about doing DI in other issues, this is at least a step in the right direction. This patch looks good - it's mostly find and replace, plus creating a mock ModuleHandler for the only affected PHPUnit test.
The patch also removes the function itself, I've seen conflicting requests from core committers about whether they want patches to do that, so I'll leave it to them to say if they want to keep it for now.
This change is already covered by a change notice that does not need updating: https://drupal.org/node/1894902
Comment #12
benjy commentedI don't really agree that we should replace the OO code if we're not going going to inject the module handler but at the very least can you create a follow up now so we have somewhere to track the OO updates.
Comment #13
xanoRe-roll.
Comment #16
ianthomas_ukThis version leaves the function itself in, as core maintainers have been requesting on other issues.
Comment #18
ianthomas_ukThe context for invokeAll() needs to be passed as a single array, there were a few examples of multiple parameters of the wrong type being passed, which caused the installation failure seen above.
Comment #20
ianthomas_ukOne more that needs the parameters in an array, not sure how I missed it.
Comment #21
xanoComment #22
catchCommitted/pushed to 8.x, thanks!