As described in #2350639: Rewrite 8.x-1.x.
We need to remove the moduleHandler usage from the composer.json generation code, replace it with the extension discovery service that allows us to crawl all modules (installed and not installed) for their composer.json files.

We need to ensure this functionality will work before Drupal core is even installed.

Comments

pcambra’s picture

I've replaced the module handler call in getComposerJsonFiles by a call that only uses the ExtensionDiscovery and shouldn't touch the database to perform the same operation:

  function getComposerJsonFiles() {
    $files =  array();
    $listing = new ExtensionDiscovery();
    $modules = $listing->scan('module');

    foreach ($modules as $module_name => $module) {
      $filepath = $module->getPath() . '/composer.json';
      $composer_json = new ComposerFile($filepath);
      if ($composer_json->exists()) {
        $files[$module_name] = $composer_json;
      }
    }

    return $files;
  }

Need to check with @bojanz about next steps

bojanz’s picture

Status: Active » Fixed

This has been achieved by the composer_manager rewrite.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.