Comments

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new17.68 KB

Adding 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.

benjy’s picture

Status: Needs review » Needs work

Do we think this might be better broken up into smaller bite size chunks?

sun’s picture

Issue summary: View changes
Issue tags: +@deprecated
internetdevels’s picture

Status: Needs work » Needs review
StatusFileSize
new14.28 KB

Rerolled patch attached.

Status: Needs review » Needs work

The last submitted patch, 4: drupal-replace_module_invoke_all-2055371-4.patch, failed testing.

xano’s picture

Status: Needs work » Needs review
StatusFileSize
new13.2 KB

Re-roll.

Status: Needs review » Needs work

The last submitted patch, 6: drupal_2055371_6.patch, failed testing.

xano’s picture

Status: Needs work » Needs review
StatusFileSize
new13.67 KB
new774 bytes
ianthomas_uk’s picture

Status: Needs review » Needs work

This is OO code, so it should be using a module_handler object directly, rather than via \Drupal()

xano’s picture

Status: Needs work » Needs review

We'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.

ianthomas_uk’s picture

Status: Needs review » Reviewed & tested by the community

Fair 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

benjy’s picture

We'll deal with dependency injection in different issues.

I 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.

xano’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new13.65 KB

Re-roll.

Status: Needs review » Needs work

The last submitted patch, 13: drupal_2055371_13.patch, failed testing.

The last submitted patch, 13: drupal_2055371_13.patch, failed testing.

ianthomas_uk’s picture

Status: Needs work » Needs review
StatusFileSize
new12.76 KB

This version leaves the function itself in, as core maintainers have been requesting on other issues.

Status: Needs review » Needs work

The last submitted patch, 16: drupal_2055371_16.patch, failed testing.

ianthomas_uk’s picture

Status: Needs work » Needs review
StatusFileSize
new11.9 KB
new1.63 KB

The 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.

Status: Needs review » Needs work

The last submitted patch, 18: drupal_2055371_18.patch, failed testing.

ianthomas_uk’s picture

Status: Needs work » Needs review
StatusFileSize
new727 bytes
new11.9 KB

One more that needs the parameters in an array, not sure how I missed it.

xano’s picture

Status: Needs review » Reviewed & tested by the community
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.