Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This could be quite a big patch and need a few re-rolls so the sooner we can get this in the better.
Meta Issue.
#1916134: Remove module_* deprecated functions
Comment | File | Size | Author |
---|---|---|---|
#59 | drupal_2045921_59.patch | 11.64 KB | ianthomas_uk |
Comments
Comment #1
juanolalla CreditAttribution: juanolalla commentedI'm working on it.
Comment #2
juanolalla CreditAttribution: juanolalla commentedI upload the patch with all the replacements.
Comment #4
juanolalla CreditAttribution: juanolalla commentedI'll try to fix it
Comment #5
michaellander CreditAttribution: michaellander commentedIf the file has a namespace, you'll have to use a global path instead of relative, like so:
Comment #6
juanolalla CreditAttribution: juanolalla commentedThank you michael! I added \Drupal... to every module file and fixed the self ModuleHandler class wich I forgot to switch to $this->invoke(). Uploading the patch and interdiff
Comment #7
benjy CreditAttribution: benjy commentedPatch no longer applies
Comment #8
juanolalla CreditAttribution: juanolalla commentedI'll do it again!
Comment #9
juanolalla CreditAttribution: juanolalla commentedUploading a new patch from scratch
Comment #11
juanolalla CreditAttribution: juanolalla commentedPrevious patch doesn't apply so I started again from scratch.
Comment #13
juanolalla CreditAttribution: juanolalla commentedI've resolved a little mistake I made yesterday.
Comment #14
benjy CreditAttribution: benjy commentedAs per: https://drupal.org/node/2045931#comment-7697279 Let's remove all the \Drupal:: from the OO code and create a new issue.
Then update this patch to replace all procedural code only.
Good work so far!
Comment #15
juanolalla CreditAttribution: juanolalla commentedGoing back to module_invoke() at OO code.
Comment #16
benjy CreditAttribution: benjy commentedLet's remove this for consistency and put it in with the OO patch. Do you want to create a new issue for the OO patch and link it from here?
Comment #17
juanolalla CreditAttribution: juanolalla commentedI've created the OO task in #2055333: Replace module_invoke() deprecated function calls in OO code
The patch doesn't apply so I'll re-roll it as soon as possible.
Comment #18
juanolalla CreditAttribution: juanolalla commentedRe-rolled.
Comment #20
benjy CreditAttribution: benjy commented#18: replace_deprecated_module_invoke-2045921-18.patch queued for re-testing.
Comment #22
juanolalla CreditAttribution: juanolalla commentedUploading a new patch from scratch.
Comment #23
benjy CreditAttribution: benjy commentedNeeds reroll and then we should be good.
Comment #24
juanolalla CreditAttribution: juanolalla commentedRe-rolled.
Comment #25
benjy CreditAttribution: benjy commentedIf the bot likes it the code looks good to me. Nice clean up!
Comment #26
star-szrNeeds a reroll.
Comment #27
star-szrTagging.
Comment #28
juanolalla CreditAttribution: juanolalla commentedRe-rolled.
Comment #29
star-szrThanks @juanolalla! Removing Needs review tag, we have a status for that :)
Comment #30
benjy CreditAttribution: benjy commentedpatch is empty.
Comment #31
juanolalla CreditAttribution: juanolalla commentedUps! Sorry, I don't know what happened, uploading re-roll patch.
Comment #31.0
juanolalla CreditAttribution: juanolalla commentedbold text
Comment #32
areke CreditAttribution: areke commentedThe patch no longer applies; it needs to be rebased.
Comment #33
Sutharsan CreditAttribution: Sutharsan commentedRerolled patch from #31.
Changes in the following files could not be applied because the code was not there anymore.
Leavings issue status at 'needs work'. Some 35 implementations of module_invoke() still remain in core.
Comment #34
Sutharsan CreditAttribution: Sutharsan commentedI miscounted (also counted the module_invoke_all()). Only 2 remained and 3 in comment or text.
I did not remove the function module_invoke() itself, as similar issues don't do that too.
Comment #38
sunComment #39
InternetDevels CreditAttribution: InternetDevels commentedLet's see what testbot says...
Comment #40
Sutharsan CreditAttribution: Sutharsan commentedOne wrong call of moduleHandler()->invoke() found. I've rand found of the failing test and all passed.
Comment #41
Sutharsan CreditAttribution: Sutharsan commentedoeps, did not notice #39 coming
Comment #42
InternetDevels CreditAttribution: InternetDevels commentedAccording to the #2053489: Standardize on \Drupal throughout core \Drupal::foo() should be used instead of Drupal::foo().
Comment #43
Sutharsan CreditAttribution: Sutharsan commentedShould this issue also add dependency injections since it introduces the use of module_handler service in classes? (i.e.
Drupal\node\NodeFormController::form()
andDrupal\user\Plugin\views\access\Permission::buildOptionsForm()
)Comment #45
benjy CreditAttribution: benjy commented42: replace_deprecated_module_invoke-2045921-42.patch queued for re-testing.
Comment #46
XanoRe-roll. I also removed
module_invoke()
itself, as related issues do it too, and it helps us make sure there is absolutely no other code still using it.Let's do that in follow-ups, where we can also unit test those classes. It would be out of scope for this issue.
Comment #47
benjy CreditAttribution: benjy commentedIn previous issues we didn't replace the OO code at all and then created a follow up to inject them properly
Comment #48
benjy CreditAttribution: benjy commented46: drupal_2045921_46.patch queued for re-testing.
Comment #50
XanoRe-roll.
Comment #51
ianthomas_ukPatch still applies and looks good to me
Comment #52
XanoRe-roll.
Comment #53
sunComment #54
XanoRe-roll.
Comment #55
sunComment #56
xjmhttps://drupal.org/node/1894902 looks like it already covers the API change for this, so I've simply added a reference to this issue there.
Comment #57
alexpottCommitted 98cdbfe and pushed to 8.x. Thanks!
Comment #58
alexpottReverted as this broke drush which is used by PIFR. Committed 12953f2 and pushed to 8.x
This cause a HEAD fail: PHP Fatal error:
Call to undefined function module_invoke() in /opt/drush/classes/DrushRole.php on line 227
https://github.com/drush-ops/drush/issues/452
We could just roll a patch without the function removal for now.
Comment #59
ianthomas_ukThis version doesn't remove module_invoke. Instead, I've updated its comment to avoid a conflict with the latest patch on #2045927: Replace all drupal_alter() deprecated function calls. and included the change from #2187735: Add removal information to docblock of all @deprecated functions to make the reroll on that one as easy as possible.
Comment is now (changes in bold)
Comment #60
ianthomas_ukI think this needs to be listed on https://drupal.org/node/1894902
And https://drupal.org/node/1816456 needs to be updated.
Comment #61
ianthomas_ukI've updated those change records so I think this is ready for RTBC again. Does anyone agree?
Comment #62
Sutharsan CreditAttribution: Sutharsan commentedI've checked the changes between #54 and #59 patches. Ok
I've checked the change in the Change Records. Ok
I've checked for any other Change Records containing module_invoke. Non applicable to change.
I've checked for remaining module_invoke() usage after this patch. None found.
Patch still applies.
All green, so back to RTBC.
Comment #63
Sutharsan CreditAttribution: Sutharsan commentedRemoving tag 'Needs change record'.
Comment #64
alexpottCommitted 5c1c02f and pushed to 8.x. Thanks!