Cant install the module.
Error message:

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "extlink_admin.settings" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 187 of core/lib/Drupal/Core/Routing/RouteProvider.php).
Drupal\Core\Routing\UrlGenerator->getRoute('extlink_admin.settings') (Line: 277)
Drupal\Core\Routing\UrlGenerator->generateFromRoute('extlink_admin.settings', Array, Array, 1) (Line: 105)
Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute('extlink_admin.settings', Array, Array, ) (Line: 735)
Drupal\Core\Url->toString() (Line: 21)
extlink_install()
call_user_func_array('extlink_install', Array) (Line: 391)
Drupal\Core\Extension\ModuleHandler->invoke('extlink', 'install') (Line: 287)
Drupal\Core\Extension\ModuleInstaller->install(Array, 1) (Line: 83)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array) (Line: 450)
Drupal\system\Form\ModulesListForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 583)
Drupal\Core\Form\FormBuilder->processForm('system_modules', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

maxmannen created an issue. See original summary.

elachlan’s picture

Issue summary: View changes

LpSolit’s picture

The recent commit doesn't fix this bug but throws the following error instead:

Uncaught PHP Exception InvalidArgumentException: "Class "\\Drupal\\extlink\\src\\Form\\ExtlinkAdminSettingsForm" does not exist."

collin.rickford’s picture

FileSize
460 bytes

In routing.yml file, class namespace should be used rather than class location (PSR-4).
\Drupal\extlink\src\Form\ExtlinkAdminSettingsForm should be \Drupal\extlink\Form\ExtlinkAdminSettingsForm

Patch attached.

  • elachlan committed 73f0833 on 8.x-1.x
    Revert "Issue #2820941: Error installing"
    
    This reverts commit...
LpSolit’s picture

Title: Error installing » Cannot install due to unknown route
Assigned: Unassigned » LpSolit

I found what the problem is. Per

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension...

hook_install() in extlink.install is not aware of routes defined in extlink.routing.yml, because this hook is called very early. So the message displayed to the admin must be printed by hook_modules_installed() which is called *after* the installation is complete and after new routes in extlink.routing.yml are available.

I have a patch ready. I will upload it in a few minutes.

LpSolit’s picture

Status: Active » Needs review
FileSize
1.39 KB

Tested with Drupal 8.2.3 + External Links 8.x-1.0-alpha3.

  • elachlan committed 15e96a1 on 8.x-1.x authored by LpSolit
    Issue #2820941 by LpSolit, collin.rickford: Cannot install due to...
elachlan’s picture

Status: Needs review » Fixed

Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.