Closed (fixed)
Project:
Drupal core
Version:
9.1.x-dev
Component:
base system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
30 Sep 2020 at 08:41 UTC
Updated:
26 Oct 2020 at 07:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alexpottThis one feels super tricky but here's what testing on core has revealed so far. Potentially anyone invoking a hook via the ModuleHandler::invoke* functions might trigger this.
Comment #4
andypostComment #5
alexpottComment #6
hussainwebI came across this same issue in core or contrib (can't remember exactly where) and the fix was the same. This is again a change in PHP 8.0 behaviour.
Comment #7
hussainwebI remember now. It was in this drush related project: https://github.com/consolidation/annotated-command/pull/210/files
Comment #8
andypostInteresting, if phpstan can catch such cases, going to check if other places needs this fix
Comment #9
catchShould we add comments to these cases explaining why the array_values() is necessary?
Comment #10
hussainwebI don't think it's very necessary to do that. This is going to be a PHP 8 effect and it shouldn't be too hard to check why is call_user_func_array with array_values a common pattern. But I'd go with the consensus here.
Comment #11
andypost++ to 10, there's git history for that
Comment #12
andypostAdded todo and follow-up #3174150: Discuss use of named arguments in Renderer::doCallback()
It needs research pro/contra but at least this place now documented
Comment #13
hussainwebMoving back to RTBC as the change is only a comment.
Comment #15
larowlanCommitted ba28c93 and pushed to 9.1.x. Thanks!