Problem/Motivation
AutowiredInstanceTrait::createInstanceAutowired() contains the following code.
if (!$container->has($service)) {
if ($parameter->allowsNull()) {
$args[] = NULL;
continue;
}
throw new AutowiringFailedException($service, sprintf('Cannot autowire service "%s": argument "$%s" of method "%s::_construct()", you should configure its value explicitly.', $service, $parameter->getName(), static::class));
}
The constructor name is wrong: It is __construct() with two underscores, like all the magic methods, not _construct().
Proposed resolution
Change the previously quoted code to the following one.
if (!$container->has($service)) {
if ($parameter->allowsNull()) {
$args[] = NULL;
continue;
}
throw new AutowiringFailedException($service, sprintf('Cannot autowire service "%s": argument "$%s" of method "%s::__construct()", you should configure its value explicitly.', $service, $parameter->getName(), static::class));
}
Comments
Comment #2
avpadernoComment #4
avpadernoComment #5
idebr commentedTest assertions need to be updated as well, see https://git.drupalcode.org/issue/drupal-3554801/-/pipelines/642260/test_...
Comment #6
avpadernoComment #7
avpaderno@idebr Thank you! If I understood correctly the report, only two tests were failing.
Comment #8
smustgrave commentedSeems straight forward. Believe random failure in JavaScript test
Comment #11
longwaveGood spot. Committed and pushed to 11.x and 11.3.x, thanks!