Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands on php 8.1 - PHP Deprecated errors #4341

Open
robertfoleyjr opened this issue Sep 17, 2022 · 0 comments
Open

Commands on php 8.1 - PHP Deprecated errors #4341

robertfoleyjr opened this issue Sep 17, 2022 · 0 comments

Comments

@robertfoleyjr
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant