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
Missing services are quietly ignored #5195
Comments
The commands in src/Drupal require a bootstrapped Drupal in order to function. You dont have that without a config sync dir. We do provide the following error in that case
Please post here if you aren't seeing that error. I will reopen the issue. |
Hmm, or maybe Drupal does bootstrap fine without a sync dir? |
Oh yes it does. drush status show full bootstrap, drush php runs fine, almost all Drupal pages load fine. Except the config sync page. |
I think then it might be Drupal's service container which wont allow the registration of this command without its dependant argument. Not sure. |
So ... trying to initiate the The question becomes then, what catches this exception? It showing up would be the very error message message missing here. And, this might mean there's a much wider bug here of something catching an exception that would be better shown? At least in verbose, if it is desired to silently just not show commands which can't be made. |
It smells as core issue |
Smells like drush to me. In Somehow we need to warn people when this causes a service to be ignored. Could be something that happens only verbose, as I mentioned above. |
This was added recently. See #5056. @DieterHolvoet - perhaps we should revert that PR and find some other solution? |
The reason I added <?php
namespace Drupal\some_module;
use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceModifierInterface;
class SomeModuleServiceProvider implements ServiceModifierInterface
{
public function alter(ContainerBuilder $container)
{
if (!$container->has('some_service')) {
$container->removeDefinition('some_module.some_command');
}
}
} Without
Any command that was once registered through a We could revert that change, or we could fix this specific issue where a missing |
Lets discuss in the PR |
Describe the bug
I am debugging a new project and they didn't send a settings.php and the one I put together accidentally ommitted
$settings["config_sync_directory"]
. drush simply omits the config import and export commands and there is no error message anywhere. I only realized when I gave up and went to/admin/config/development/configuration
in the UI.To Reproduce
What did you do?
Oh dear, what have I done, yeah, that's what I am asking myself in the long lonely nights. But in this case see above.
Expected behavior
Maybe something in
drush status
?Actual behavior
What happened instead?
drush config:import is just missing
Workaround
Is there another way to do the desired action?
Not really.
The text was updated successfully, but these errors were encountered: