-
-
Notifications
You must be signed in to change notification settings - Fork 554
Closed

Description
Generate content entity: Revision links broken
[ ISSUE-GROUP ]
generate:entity:content
template
Problem/Motivation
Visiting revision page for generated entity at admin/structure/{entity_type}/{entity_id}/revisions results in the following error:
The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal\movie_academy_director\Entity\Director::link() in Drupal\movie_academy_director\Controller\DirectorController->revisionOverview() (line 127 of /home/alexanderverbruggen/Repositories/gitlab.hosted-tools.com/movie_academy/htdocs/lib/modules/custom/movie_academy_director/src/Controller/DirectorController.php).
Drupal\movie_academy_director\Controller\DirectorController->revisionOverview(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 578)
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}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 717)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
How to reproduce
drupal generate:entity:content
(make it revisionable)- create an entity
- visit admin/structure/{entity_type}/{entity_id}/revisions
Solution
Use Link class and entity link function.
Metadata
Metadata
Assignees
Labels
No labels