Scheduler Rules Integration tests are failing with

Exception: Error: Unknown named parameter $node
call_user_func_array()()

This is a PHP8 problem, regarding named parameters.

Issue fork scheduler-3276637

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Issue summary: View changes

This Rules issue may have some help
#3210303: PHP 8 introduced breaking change to call_user_func_array()

The failure is for all entity types, for example

2) Drupal\Tests\scheduler_rules_integration\Functional\SchedulerRulesConditionsTest::testEntityTypeEnabledConditions with data set "#media" ('media', 'test_video')
Exception: Error: Unknown named parameter $media
call_user_func_array()() (Line: 70)
jonathan1055’s picture

The context variables in our derived conditions and actions are named 'node', 'media', 'commerce_product' and 'taxonomy_term'. However, the doEvaluate() in our conditions and the doExecute() in our actions have one parameter $entity. Therefore the fix for this is to make the derivers create a consistent context variable name 'entity', instead of using "$entity_type_id".

jonathan1055’s picture

Status: Active » Needs review

This has fixed the Unknown named parameter in call_user_func_array() error.

jonathan1055’s picture

Title: Rules Integration tests fail at php8 » Make Rules Integration compatible with php8

Better title

  • jonathan1055 committed a99315e on 2.x
    Issue #3276637 by jonathan1055: Make Rules Integration compatible with...
jonathan1055’s picture

Status: Needs review » Fixed

Tested manually and all fine.

Status: Fixed » Closed (fixed)

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