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

Bug: AutoloaderRegistry::getAutoloader returns array #26479

Closed
lbajsarowicz opened this issue Jan 21, 2020 · 2 comments
Closed

Bug: AutoloaderRegistry::getAutoloader returns array #26479

lbajsarowicz opened this issue Jan 21, 2020 · 2 comments
Assignees
Labels
Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@lbajsarowicz
Copy link
Contributor

lbajsarowicz commented Jan 21, 2020

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.

@m2-assistant
Copy link

m2-assistant bot commented Jan 21, 2020

Hi @lbajsarowicz. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@lbajsarowicz do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

lbajsarowicz added a commit to lbajsarowicz/magento2-contributions that referenced this issue Jan 21, 2020
… instead of passing the error to higher levels
@ghost ghost assigned lbajsarowicz Jan 21, 2020
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jan 21, 2020
@slavvka
Copy link
Member

slavvka commented Feb 7, 2020

Hi @lbajsarowicz. Thank you for your report.
The issue has been fixed in #26480 by @lbajsarowicz in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.0 release.

@slavvka slavvka added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Feb 7, 2020
@slavvka slavvka closed this as completed Feb 7, 2020
magento-engcom-team added a commit that referenced this issue Feb 7, 2020
…ed properly #26480

 - Merge Pull Request #26480 from lbajsarowicz/magento2:bugfix/autoloader-array
 - Merged commits:
   1. ab1b1de
   2. 61bc535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

3 participants