drupal-console icon indicating copy to clipboard operation
drupal-console copied to clipboard

Commands on php 8.1 - PHP Deprecated errors

Open robertfoleyjr opened this issue 3 years ago • 0 comments

Code - Drupal Console on php 8.1 throws errors on every command

Problem/Motivation

Running Drupal Console 1.9.8 in PHP 8.1 throws errors on any and all commands.

Details to include:

  • Why are we doing this? Above all, a summary should explain why a change is needed, in a few short sentences.

How to reproduce

While running PHP 8.1 Install Drupal Console via composer, issue a command

Error produces:

PHP Deprecated: preg_replace_callback(): Passing null to parameter #3 ($subject) of type array|string is deprecated in phar:///usr/local/bin/drupal/vendor/dflydev/placeholder-resolver/src/Dflydev/PlaceholderResolver/RegexPlaceholderResolver.php on line 57 PHP Stack trace: PHP 1. {main}() /usr/local/bin/drupal:0 PHP 2. require() /usr/local/bin/drupal:10 PHP 3. require() phar:///usr/local/bin/drupal/bin/drupal:3 PHP 4. Drupal\Console\Core\Utils\ConfigurationManager->loadConfiguration($directory = '/srv/drupal/drupal9/ncela/code/pantheon-d9') phar:///usr/local/bin/drupal/bin/drupal.php:50 PHP 5. Dflydev\DotAccessConfiguration\AbstractConfiguration->get($key = 'application.extras.aliases') phar:///usr/local/bin/drupal/vendor/drupal/console-core/src/Utils/ConfigurationManager.php:83 PHP 6. Dflydev\DotAccessConfiguration\AbstractConfiguration->resolveValues($input = NULL) phar:///usr/local/bin/drupal/vendor/dflydev/dot-access-configuration/src/Dflydev/DotAccessConfiguration/AbstractConfiguration.php:42 PHP 7. Dflydev\PlaceholderResolver\RegexPlaceholderResolver->resolvePlaceholder($placeholder = NULL) phar:///usr/local/bin/drupal/vendor/dflydev/dot-access-configuration/src/Dflydev/DotAccessConfiguration/AbstractConfiguration.php:156 PHP 8. preg_replace_callback($pattern = '/%([a-zA-Z0-9\.\(\)_\:]+?)%/', $callback = [0 => class Dflydev\PlaceholderResolver\RegexPlaceholderResolverCallback { private $dataSource = class Dflydev\DotAccessConfiguration\ConfigurationDataSource { ... } }, 1 => 'callback'], $subject = NULL) phar:///usr/local/bin/drupal/vendor/dflydev/placeholder-resolver/src/Dflydev/PlaceholderResolver/RegexPlaceholderResolver.php:57

Details to include:

  • Drupal version 9.4.5
  • Console version 1.9.8
  • Console Launcher version 1.9.8
  • Steps to reproduce issue any command: drupal [command]

Solution

For now I attempt to run commands even with errors.

robertfoleyjr avatar Sep 17 '22 01:09 robertfoleyjr