When visiting /admin/reports/upgrade-status with upgrade_status 5.0.x-alpha installed, the following fatal error is thrown:

Error: Class "DrupalFinder\DrupalFinderComposerRuntime" not found in
Drupal\upgrade_status\DeprecationAnalyzer->initEnvironment()
(line 224 of modules/contrib/upgrade_status/src/DeprecationAnalyzer.php).

Cause

DeprecationAnalyzer now uses DrupalFinder\DrupalFinderComposerRuntime, which was introduced in webflo/drupal-finder 1.3.0. However, the module's composer.json declares the dependency as "webflo/drupal-finder": "^1.2", which allows Composer to resolve version 1.2.x where this class does not exist.

Projects that have webflo/drupal-finder pinned to 1.2.x will hit this error.

Steps to reproduce

  1. Have webflo/drupal-finder at version 1.2.x installed (e.g. pinned in your root composer.json).
  2. Install drupal/upgrade_status:^5.0@alpha.
  3. Visit /admin/reports/upgrade-status.

Fix

Update webflo/drupal-finder to ^1.3:

composer require "webflo/drupal-finder:^1.3" --update-with-dependencies

After running this, clear Drupal's cache:

drush cache:rebuild

Note for DDEV users: Even after updating the package and rebuilding caches, you may still see the error if OPcache in the web container is serving stale data. If the error persists after drush cache:rebuild, a full DDEV restart is required to flush OPcache:

ddev restart

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dallen33 created an issue. See original summary.

nickolaj made their first commit to this issue’s fork.

nickolaj’s picture

Status: Active » Needs review

Updated composer.json to require `webflo/drupal-finder: ^1.3` instead of `^1.2`, since the `DrupalFinderComposerRuntime` class used in `DeprecationAnalyzer.php` was introduced in 1.3.0.

dallen33’s picture

Fix works great for me.