Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "taxonomy_term" for route "entity.taxonomy_term.canonical" must match "[^/]++" ("" given) to generate a corresponding URL. in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 193 of core/lib/Drupal/Core/Routing/UrlGenerator.php).

Drupal\Core\Routing\UrlGenerator->getInternalPathFromRoute('entity.taxonomy_term.canonical', Object, Array, Array) (Line: 305)
Drupal\Core\Routing\UrlGenerator->generateFromRoute('entity.taxonomy_term.canonical', Array, Array, 1) (Line: 105)
Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute('entity.taxonomy_term.canonical', Array, Array, 1) (Line: 735)
Drupal\Core\Url->toString(1) (Line: 157)
Drupal\Core\Utility\LinkGenerator->generate('mytest', Object) (Line: 582)
Drupal::l('bbbbb', Object) (Line: 146)
Drupal\webfactory_slave\Form\TableEntitiesForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 512)
Drupal\Core\Form\FormBuilder->retrieveForm('webfactory_slave_tableentities_form', Object) (Line: 271)
Drupal\Core\Form\FormBuilder->buildForm('Drupal\webfactory_slave\Form\TableEntitiesForm', Object) (Line: 212)
Drupal\Core\Form\FormBuilder->getForm('Drupal\webfactory_slave\Form\TableEntitiesForm') (Line: 24)
Drupal\webfactory_slave\Controller\WebfactorySlaveController->remoteEntitiesSync()
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: 98)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 77)
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: 628)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Comments

Grimreaper created an issue. See original summary.

DeFr’s picture

Status: Active » Needs review
FileSize
992 bytes

Hardcoding $local_entity->nid won't fly for entity that are not nodes. Attached patch fix the exception, using ::toLink to simplify the code at the same time.

That being said, this clearly isn't the only occurrence of node specific field being used ; let's fix the exception first.

DeFr’s picture

Uploading a better patch to avoid leaving $url hanging around unused.

  • DeFr authored b340f6b on 8.x-1.x
    Issue #2805261 by DeFr, Grimreaper: Fatal error when trying to import...
Grimreaper’s picture

Status: Needs review » Fixed

Doing a manual test: OK

Merged.

Thanks for the patch.

  • Grimreaper authored d34a5d7 on 8.x-1.x
    Issue #2805261 by Grimreaper: Remove unused import.
    

Status: Fixed » Closed (fixed)

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