Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate content entity: Revision links broken #4317

Closed
ghost opened this issue Sep 15, 2021 · 1 comment
Closed

Generate content entity: Revision links broken #4317

ghost opened this issue Sep 15, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 15, 2021

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.

@LOBsTerr
Copy link
Member

Thanks for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant