acquia / drupal-environment-detector

Provides common methods for detecting the current Acquia environment
GNU General Public License v2.0
10 stars 12 forks source link

DX-5167: Upgrading to 1.5.0 causes compatibility error #49

Closed loopy3025 closed 1 year ago

loopy3025 commented 2 years ago

We were running drupal core 9.4.0 with acquia/blt 13.4.0 and acquia/drupal-environment-detector 1.4.1. After running composer update, we upgraded drupal core (we tried 9.4.5 and 9.4.3) which increased the environment detector to 1.5.0. When running any blt command, even blt update, we got the following.

Fatal error: Declaration of Acquia\Blt\Robo\Common\EnvironmentDetector::getSiteName($site_path) must be compatible with Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector::getSiteName(string $site_path): ?string in /var/www/vendor/acquia/blt/src/Robo/Common/EnvironmentDetector.php on line 236

We pinned environment detector to 1.4.1 in composer.json and the errors have ceased, however I suspect that is unsustainable in the long run. For now, this works with core 9.4.5 and BLT 13.4.0.

We're (justifiably) a bit dubious about our BLT upgrades considering the regressions we've expereinced in the past, but we can't troubleshoot that right now. If a higher version of blt is required to work with environment detector 1.5.0, then composer requirements should probably reflect that.

loopy3025 commented 2 years ago

Confirmed that 1.5.0 is not compatible with blt 13.4. In order to run, blt (and hence drush) need to be updated. The next minor version of this project's 1.4.x should probably reflect a conflict with blt <13.5 or it should be made compatible.

loopy3025 commented 2 years ago

I guess yolo upgrade BLT and Drush. Pray for us.

roger-ab-inbev commented 2 years ago

I'm having the same problem, any news?

mjgruta commented 1 year ago

any updates? We did a forced downgrade to make this work for now composer require acquia/drupal-environment-detector:1.4.1

loopy3025 commented 1 year ago

any updates? We did a forced downgrade to make this work for now composer require acquia/drupal-environment-detector:1.4.1

That's exactly what we did on some of our sites for now. Other sites, we went ahead and performed the Drush upgrade. No issues yet, even on sites running php 8.1

DarkteK commented 1 year ago

Hi, Any updates on this issue? I applied 1.4.1 in my composer.lock in order to downgrade the current version

danepowell commented 1 year ago

I think this is solved by #55 which prevents conflicting versions of BLT and the detector from being installed.