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

PHP 7.4 getDirectory() Error #5655

Open
ghazlawl opened this issue Jun 13, 2023 · 4 comments
Open

PHP 7.4 getDirectory() Error #5655

ghazlawl opened this issue Jun 13, 2023 · 4 comments
Labels

Comments

@ghazlawl
Copy link

ghazlawl commented Jun 13, 2023

Describe the bug
When upgrading Drush from 11.5.1 to 11.6.0 in our PHP 7.4 environments we noticed that our drush config:import commands have stopped working due to a fatal error (below). We believe that this commit (Line 393) adds the mixed type that was not introduced until PHP 8.

The Drush Compatibility page states that Drush 11.x should be compatible with PHP 7 and the use of the mixed type violates that statement.

PHP.net states that the mixed type was not introduced until PHP 8.0.0.

TypeError: Argument 1 passed to Drush\Drupal\Commands\config\ConfigCommands::getDirectory() must be an instance of Drush\Drupal\Commands\config\mixed or null, string given, called in /drupal/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php on line 220 in /drupal/vendor/drush/drush/src/Drupal/Commands/config/ConfigCommands.php on line 393 #0 /drupal/vendor/drush/drush/src/Drupal/Commands/config/ConfigImportCommands.php(220)

To Reproduce
To reproduce, simply upgrade Drush to 11.6.0 in a PHP 7.4 environment and run any drush config:import command to import configuration.

Expected behavior
The expected behavior is that the configuration would be imported.

Actual behavior
The actual behavior is that the configuration is not imported due to a TypeError.

Workaround
Upgrade PHP to 8.0.0+ or downgrade Drush to 11.5.1.

System Configuration

Q A
Drush version? 11.6.0
Drupal version? 9.5.9
PHP version 7.4
OS? Mac/Linux
@apathak18
Copy link

++ Attaching the screenshot for reference
Screenshot 2023-06-14 at 9 24 53 AM

@greg-1-anderson
Copy link
Member

I turned testing for PHP 7.4 back on in #5655 and fixed the issue reported here. There is one more test failure that needs to be fixed before we can merge and make a new release.

@mkalkbrenner
Copy link

Thanks for fixing this issue. A new release will hopefully fix our integration tests:
https://github.com/mkalkbrenner/search_api_solr/actions/runs/5280747852/jobs/9553368656

@adam-vessey
Copy link

Just ran into this, and yeah, keeping Drush back at 11.5.1 seems to do the trick.

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

No branches or pull requests

6 participants