See https://wiki.php.net/rfc/named_params and scroll down to call_user_func_array().
call_user_func_array() is used by Rules core to invoke conditions/actions, which each define their own set of context variables that need to passed in as parameters.
Core dealt with this in #3174022: call_user_func_array() and named arguments in PHP 8.
I opened this as a separate issue from #3210303: PHP 8 introduced breaking change to call_user_func_array() because, although the cause is the same, the affected code is quite different in D7 than it was in D8. So the solution is not a backport of the D8 solution, it is a different solution in a different part of the codebase.
However, #3210303: PHP 8 introduced breaking change to call_user_func_array() does include some discussion of the problem which is also relevant.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3210622-5.patch | 1.5 KB | tr |
| #2 | 3210622-2.patch | 739 bytes | tr |
Comments
Comment #2
tr commentedThe relevant errors shown in the test output https://www.drupal.org/pift-ci-job/2039308 are:
These occur in the faces code, which is specific to the D7 version of Rules. And as faces is a lot more dynamic than other parts of the code, here's a small patch which should help without major structural changes.
Comment #3
tr commentedComment #4
tr commentedComment #5
tr commentedComment #6
tr commented#5 seems to have worked to solve the problems that show up in our tests. There are several other usages of
call_user_func_array()in the codebase that don't cause test failures, perhaps because the tests might not cover those usages. Those usages are found inpath.eval.inc,rules.module, andrules.state.inc. To find out if these are a problem, someone will have to try to exercise those pieces of code manually on a D7 site with PHP 8 installed. If they ARE a problem, then it would be ideal if we could add the missing test coverage.My thought is we should just commit #5 now and leave this issue open to see if someone encounters a problem with one of those other usages.
Comment #7
liam morlandI have reviewed the code. This will fix the problem without any side-effects.
Comment #8
liam morlandComment #10
tr commentedCommitted #5.
Comment #12
joseph.olstadas per
#3221001-13: Plan for release of 7.x-1.10
Please tag and release rules 7.x-2.x
Comment #13
joseph.olstadthere's a chain of events that have to happen for us to resolve file_entity and media module php 8.0 automated test passing as media relies on file_entity, which in turn automated tests depend on the entity api which in turn relies on rules for it's automated test coverage dependency.
so , in this order: