Skip to content

Bug: AutoloaderRegistry::getAutoloader returns array #26479

Closed
@lbajsarowicz

Description

@lbajsarowicz

Preconditions (*)

  1. Cloned magento/magento2 repository (without changes)
  2. Installed Composer dependencies

Steps to reproduce (*)

  1. Configure and run Integration Tests

Expected result (*)

  1. Integration Tests should pass

Actual result (*)

  1. Randomly you get error Error: Call to a member function findFile() on array (/var/www/html/lib/internal/Magento/Framework/Code/Generator/DefinedClasses.php:59)

Comments

Actual source of issue is in: \Magento\Framework\Autoload\AutoloaderRegistry::getAutoloader

public static function getAutoloader()
{
if (self::$autoloader !== null) {
return self::$autoloader;
} else {
throw new \Exception('Autoloader is not registered, cannot be retrieved.');
}
}

For some cases just composer dump-autoload helps, but it's not always the case.

Metadata

Metadata

Assignees

Labels

Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions