- 🇷🇴Romania amateescu
Merged into 3.x, thanks @denes.szabo for starting the work on this!
-
amateescu →
committed 73f5cefe on 3.x authored by
denes.szabo →
Issue #3506212 by amateescu, denes.szabo: Regression: 'restore' and '...
-
amateescu →
committed 73f5cefe on 3.x authored by
denes.szabo →
- 🇷🇴Romania amateescu
So, the fix is simple: if an entity has no link template for these actions, then do not provide them.
I'm afraid it's not that simple :) Trash support could be enabled only for certain bundles of an entity type, which would make the link templates available for it. What I missed in 🐛 Users without permission still see action links Active is that we need to forbid the
restore
andpurge
operations for entity types that are not trash-enabled. - First commit to issue fork.
- @denesszabo opened merge request.
- 🇭🇺Hungary denes.szabo Hungary
The problem is: the trash module provides operation links for entities to restore or purge the entity from trash.
But, before you need to configure the module to allow the trash functionality to the entity type. If the trash already enabled to the entity type, then the purge and restore link templates will be added to the entity.
So, the fix is simple: if an entity has no link template for these actions, then do not provide them.
I have similar problem: on a fresh Drupal CMS install I am not able to access the dashboard or people list page, I got this error.
The website encountered an unexpected error. Try again later. Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: No link template 'restore' found for the 'dashboard' entity type in Drupal\Core\Entity\EntityBase->toUrl() (line 211 of core/lib/Drupal/Core/Entity/EntityBase.php). Drupal\Core\Config\Entity\ConfigEntityBase->toUrl() (Line: 160) Drupal\dashboard\Entity\Dashboard->toUrl() (Line: 393) trash_entity_operation() call_user_func_array() (Line: 355) Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 307) Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 354) Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 133) Drupal\Core\Entity\EntityListBuilder->getOperations() (Line: 242) Drupal\Core\Entity\EntityListBuilder->buildOperations() (Line: 224) Drupal\Core\Entity\EntityListBuilder->buildRow() (Line: 108) Drupal\Core\Config\Entity\DraggableListBuilder->buildRow() (Line: 40) Drupal\dashboard\DashboardListBuilder->buildRow() (Line: 163) Drupal\Core\Config\Entity\DraggableListBuilder->buildForm() call_user_func_array() (Line: 528) Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 279) Drupal\Core\Form\FormBuilder->buildForm() (Line: 97) Drupal\autosave_form\Form\AutosaveFormBuilder->buildForm() (Line: 219) Drupal\Core\Form\FormBuilder->getForm() (Line: 121) Drupal\Core\Config\Entity\DraggableListBuilder->render() (Line: 23) Drupal\Core\Entity\Controller\EntityListController->listing() call_user_func_array() (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593) Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183) Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32) Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90) Drupal\page_cache\StackMiddleware\PageCache->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: 709) Drupal\Core\DrupalKernel->handle() (Line: 19)
I have the fix, I am trying to create a merge request…
- 🇭🇺Hungary denes.szabo Hungary
denes.szabo → made their first commit to this issue’s fork.
- Issue created by @sushichris