You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[router:rebuild] command uses router_builder service (see RouteBuilderInterface) for rebuilding routes. The "rebuild" method can return TRUE if rebuild was successful or FALSE if there were any errors. But RebuildCommand does not handle it:
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->getIo()->newLine();
$this->getIo()->comment(
$this->trans('commands.router.rebuild.messages.rebuilding')
);
// HERE - there are no if, just 'rebuild' call and 'success' call next.
$this->routerBuilder->rebuild();
$this->getIo()->success(
$this->trans('commands.router.rebuild.messages.completed')
);
}
As for me, better to display some error message.
How to reproduce
Just acquire the 'router_rebuild' database lock in other place - and call [router:rebuild] command without lock release.
Details
Drupal version: 8.6.1;
Console version: 1.8.0;
Console Launcher version: 1.8.0.
The text was updated successfully, but these errors were encountered:
Hi @enzolutions , thanks for your response.
I have no installed drupal for now, but following code should work: \Drupal::service('lock')->acquire('router_rebuild')
Then do something to execute that [router:rebuild] command, and you will see that $this->routerBuilder->rebuild(); returns "false".
Unfortunately I dont remember in which case I faced that. Probably I called some other command which worked with router and then called "router rebuild" command in it.
Problem/Motivation
[router:rebuild] command uses router_builder service (see RouteBuilderInterface) for rebuilding routes. The "rebuild" method can return TRUE if rebuild was successful or FALSE if there were any errors. But RebuildCommand does not handle it:
As for me, better to display some error message.
How to reproduce
Just acquire the 'router_rebuild' database lock in other place - and call [router:rebuild] command without lock release.
Details
The text was updated successfully, but these errors were encountered: