3.1.0 release causes EntityStorageException

Created on 22 March 2024, over 1 year ago

I'm unsure what exactly causes this but with views_url_alias 3.1.0 a DELETE request via JSON:API on a node results in a 500 error:

/app/cms/web/core/lib/Drupal/Core/Entity/EntityBase.php(362): Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete(Array)
#1 /app/cms/web/core/modules/jsonapi/src/Controller/EntityResource.php(388): Drupal\Core\Entity\EntityBase->delete()
#2 [internal function]: Drupal\jsonapi\Controller\EntityResource->deleteIndividual(Object(Drupal\node\Entity\Node))

With 3.0.0 everything works as expected.

πŸ› Bug report
Status

Active

Version

3.1

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland yobottehg Basel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @yobottehg
  • πŸ‡¨πŸ‡¦Canada dstorozhuk Chicago πŸ‡ΊπŸ‡Έ, Toronto πŸ‡¨πŸ‡¦, Kyiv πŸ‡ΊπŸ‡¦

    >3.0.0 everything works as expected.
    Because in 3.0.0 on Drupal version 8.8 and above the hooks which suppose to update/insert/delete records in views_url_alias table was never triggered.
    That it why you had an impression that everything was working fine. Your site, if it is on Drupal version 8.8 and above, might use outdated data that was installed on the first time of the module installation.
    Please check that.
    Which Drupal version are you using?

  • Status changed to Postponed: needs info 2 months ago
  • πŸ‡¬πŸ‡§United Kingdom rachel_norfolk UK

    Setting to maintainer needs more info as that’s kinda what we are looking for.

  • πŸ‡³πŸ‡ΏNew Zealand Josh Waihi

    I've encountered this issue when attempting to delete a node with a source language that wasn't the default language:

    The website encountered an unexpected error. Try again later.
    
    Drupal\Core\Entity\EntityStorageException: The "node" parameter was not converted for the path "/node/{node}" (route name: "entity.node.canonical") in Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete() (line 764 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
    Drupal\Core\Routing\Enhancer\ParamConversionEnhancer->enhance() (Line: 276)
    Drupal\Core\Routing\Router->applyRouteEnhancers() (Line: 156)
    Drupal\Core\Routing\Router->matchRequest() (Line: 141)
    Drupal\Core\Routing\Router->match() (Line: 25)
    views_url_alias_get_path_enitiy_type() (Line: 74)
    views_url_alias_path_alias_delete()
    call_user_func_array() (Line: 416)
    Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 395)
    Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 415)
    Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 215)
    Drupal\Core\Entity\EntityStorageBase->invokeHook() (Line: 900)
    Drupal\Core\Entity\ContentEntityStorageBase->invokeHook() (Line: 462)
    Drupal\Core\Entity\EntityStorageBase->delete() (Line: 754)
    Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete() (Line: 247)
    Drupal\pathauto\AliasStorageHelper->deleteMultiple() (Line: 182)
    Drupal\pathauto\AliasStorageHelper->deleteBySourcePrefix() (Line: 202)
    Drupal\pathauto\AliasStorageHelper->deleteEntityPathAll() (Line: 104)
    pathauto_entity_delete()
    call_user_func_array() (Line: 416)
    Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 395)
    Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 415)
    Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 217)
    Drupal\Core\Entity\EntityStorageBase->invokeHook() (Line: 900)
    Drupal\Core\Entity\ContentEntityStorageBase->invokeHook() (Line: 462)
    Drupal\Core\Entity\EntityStorageBase->delete() (Line: 754)
    Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete() (Line: 362)
    Drupal\Core\Entity\EntityBase->delete() (Line: 71)
    Drupal\Core\Entity\ContentEntityDeleteForm->submitForm()
    call_user_func_array() (Line: 129)
    Drupal\Core\Form\FormSubmitter->executeSubmitHandlers() (Line: 67)
    Drupal\Core\Form\FormSubmitter->doSubmitForm() (Line: 597)
    Drupal\Core\Form\FormBuilder->processForm() (Line: 144)
    Drupal\autosave_form\Form\AutosaveFormBuilder->processForm() (Line: 326)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 97)
    Drupal\autosave_form\Form\AutosaveFormBuilder->buildForm() (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult() (Line: 39)
    Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 637)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 54)
    Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle() (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 53)
    Asm89\Stack\Cors->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
    

    I'm guessing the issue on delete hooks is that the data is no longer present to retrieve.

  • πŸ‡³πŸ‡ΏNew Zealand Josh Waihi
  • πŸ‡¬πŸ‡§United Kingdom rachel_norfolk UK

    @josh waihi - can you let me know what version of Drupal Core you were using?

Production build 0.71.5 2024