Problem/Motivation

After upgrading my site from drupal 9.0.9 to 9.1.0 I got this error with PHP 8

Deprecated: Required parameter $bubbleable_metadata follows optional parameter $data in D:\wamp64\www\workbench\workbench_d9_test1\modules\contrib\token\token.tokens.inc on line 427

Deprecated: Required parameter $bubbleable_metadata follows optional parameter $data in D:\wamp64\www\workbench\workbench_d9_test1\modules\contrib\token\token.tokens.inc on line 1100

Deprecated: Required parameter $bubbleable_metadata follows optional parameter $data in D:\wamp64\www\workbench\workbench_d9_test1\modules\contrib\token\token.tokens.inc on line 1218

Deprecated: Required parameter $bubbleable_metadata follows optional parameter $data in D:\wamp64\www\workbench\workbench_d9_test1\modules\contrib\token\token.tokens.inc on line 1555
The website encountered an unexpected error. Please try again later.
ArgumentCountError: Too few arguments to function Drupal\ultimate_cron\Logger\LogEntry::__construct(), 0 passed and at least 2 expected in Drupal\ultimate_cron\Logger\LogEntry->__construct() (line 53 of modules\contrib\ultimate_cron\src\Logger\LogEntry.php).
Fatal error: Uncaught Error: Call to a member function prepare() on null in D:\wamp64\www\workbench\workbench_d9_test1\core\lib\Drupal\Core\Database\StatementWrapper.php:49 Stack trace: #0 D:\wamp64\www\workbench\workbench_d9_test1\core\lib\Drupal\Core\Database\Connection.php(557): Drupal\Core\Database\StatementWrapper->__construct(Object(Drupal\Core\Database\Driver\mysql\Connection), NULL, 'DELETE FROM "ke...', Array) #1 D:\wamp64\www\workbench\workbench_d9_test1\core\lib\Drupal\Core\Database\Connection.php(822): Drupal\Core\Database\Connection->prepareStatement('DELETE FROM "ke...', Array) #2 D:\wamp64\www\workbench\workbench_d9_test1\core\lib\Drupal\Core\Database\Driver\mysql\Connection.php(88): Drupal\Core\Database\Connection->query('DELETE FROM {ke...', Array, Array) #3 D:\wamp64\www\workbench\workbench_d9_test1\core\lib\Drupal\Core\Database\Query\Delete.php(55): Drupal\Core\Database\Driver\mysql\Connection->query('DELETE FROM {ke...', Array, Array) #4 D:\wamp64\www\workbench\workbench_d9_test1\core\lib\Drupal\Core\KeyValueStore\DatabaseStorage.php(241): Drupal\Core\Database\Query\Delete->execute() #5 D:\wamp64\www\workbench\workbench_d9_test1\modules\contrib\business_rules\src\Util\BusinessRulesProcessor.php(766): Drupal\Core\KeyValueStore\DatabaseStorage->deleteAll() #6 [internal function]: Drupal\business_rules\Util\BusinessRulesProcessor->__destruct() #7 {main} thrown in D:\wamp64\www\workbench\workbench_d9_test1\core\lib\Drupal\Core\Database\StatementWrapper.php on line 49

and when I revert back to PHP 7.4.12 i get different error on drupal 9.1.0

The website encountered an unexpected error. Please try again later.
ArgumentCountError: Too few arguments to function Drupal\ultimate_cron\Logger\LogEntry::__construct(), 0 passed and at least 2 expected in Drupal\ultimate_cron\Logger\LogEntry->__construct() (line 53 of modules\contrib\ultimate_cron\src\Logger\LogEntry.php).
( ! ) Fatal error: Uncaught Error: Call to a member function prepare() on null in D:\wamp64\www\workbench\workbench_d9_test1\core\lib\Drupal\Core\Database\StatementWrapper.php on line 49
Call Stack
#	Time	Memory	Function	Location
1	5.8288	39657384	_drupal_exception_handler( )	...\bootstrap.inc:0
2	5.8294	39667872	_drupal_log_error( )	...\bootstrap.inc:323
( ! ) Error: Call to a member function prepare() on null in D:\wamp64\www\workbench\workbench_d9_test1\core\lib\Drupal\Core\Database\StatementWrapper.php on line 49
Call Stack
#	Time	Memory	Function	Location
1	5.8288	39657384	_drupal_exception_handler( )	...\bootstrap.inc:0
2	5.8294	39667872	_drupal_log_error( )	...\bootstrap.inc:323
3	5.8402	39697832	Drupal\business_rules\Util\BusinessRulesProcessor->__destruct( )	...\BusinessRulesProcessor.php:0
4	5.8402	39697832	Drupal\Core\KeyValueStore\DatabaseStorageExpirable->deleteAll( )	...\BusinessRulesProcessor.php:766
5	5.8403	39699536	Drupal\Core\Database\Query\Delete->execute( )	...\DatabaseStorage.php:241
6	5.8403	39700160	Drupal\Core\Database\Driver\mysql\Connection->query( )	...\Delete.php:55
7	5.8403	39700160	Drupal\Core\Database\Driver\mysql\Connection->query( )	...\Connection.php:88
8	5.8403	39700640	Drupal\Core\Database\Driver\mysql\Connection->prepareStatement( )	...\Connection.php:822
9	5.8403	39700864	Drupal\Core\Database\StatementWrapper->__construct( )	...\Connection.php:557

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

bmustafa created an issue. See original summary.

cilefen’s picture

larowlan’s picture

Category: Bug report » Support request
Priority: Critical » Normal
dwkitchen’s picture

Status: Active » Closed (duplicate)
Related issues: +#3173359: Deprecation errors when trying to install the module on PHP 8

Duplicate of #3173359: Deprecation errors when trying to install the module on PHP 8

And was resolved in the Token 8.x-1.9 release.