After replacing 'url(' to '\Drupal::url(', and trying to install xmlsitemap, this error/warning shows up above the Drupal message: "The website has encountered an error. Please try again later."

  • Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Routing\RouteProvider->getRoutesByNames() (line 189 of core/lib/Drupal/Core/Routing/RouteProvider.php).
    Drupal\Core\Routing\RouteProvider->getRoutesByNames(Array)
    Drupal\Core\Routing\RouteProvider->getRouteByName(NULL)
    Drupal\Core\Routing\UrlGenerator->getRoute(NULL)
    Drupal\Core\Routing\UrlGenerator->generateFromRoute(NULL, Array, Array)
    Drupal::url(NULL, Array)
    xmlsitemap_install()
    call_user_func_array('xmlsitemap_install', Array)
    Drupal\Core\Extension\ModuleHandler->invoke('xmlsitemap', 'install')
    Drupal\Core\Extension\ModuleInstaller->install(Array)
    Drupal\system\Form\ModulesListForm->submitForm(Array, Object)
    call_user_func_array(Array, Array)
    Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object)
    Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object)
    Drupal\Core\Form\FormBuilder->processForm('system_modules', Array, Object)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object)
    Drupal\Core\Controller\FormController->getContentResult(Object)
    call_user_func_array(Array, Array)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
    Drupal\Core\StackMiddleware\PageCache->handle(Object, 1, 1)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
    Stack\StackedHttpKernel->handle(Object, 1, 1)
    Drupal\Core\DrupalKernel->handle(Object)
    
  • Comments

    AkshayKalose’s picture

    Title: Fatal Error: Drupal\Core\Form\FormState as array » array_flip(): Can only flip STRING and INTEGER values!
    amateescu’s picture

    Status: Active » Closed (outdated)

    This error doesn't happen anymore.