I fail to open /admin/gdpr/tasks page with the following error:
The website encountered an unexpected error. Please try again later.
Error: Call to a member function toLink() on null in Drupal\gdpr_tasks\TaskListBuilder->buildRow() (line 77 of modules/gdpr/modules/gdpr_tasks/src/TaskListBuilder.php).
Drupal\gdpr_tasks\TaskListBuilder->buildRow(Object) (Line: 179)
Drupal\gdpr_tasks\TaskListBuilder->render() (Line: 23)
Drupal\Core\Entity\Controller\EntityListController->listing('gdpr_task')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
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: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
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: 50)
Drupal\ban\BanMiddleware->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: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Drupal 8 and all modules are fully updated, and I have tried flush cache.
FYI: /admin/gdpr/tasks/gdpr_task_type works OK.
Comments
Comment #2
matus grinvalsky commentedComment #3
matus grinvalsky commentedSeems that problem was caused by RTF being initiated by user that had been deleted before GDPR RTF task had been reviewed by admin and run.
Once I deleted the RTF task for non/existent user, the issue had been fixed.
Seems like better handling of this scenario is needed...
Comment #6
mrdalesmith commentedThis is because the TaskLIstBuilder is attempting to get a link from a user that no longer exists to display their request in the table: the code used is standard so I don't think it's the problem - the real issue is that the GDPR Tasks module doesn't respond correctly to users being deleted.
There's probably a conversation to be had about whether the code should carry out a full Request To Forget process for the user without admin approval if their account is being deleted, but for now I've just added code to delete any GDPR Task entities related to a user if their account is deleted.
Comment #7
rajeshreeputraworks good, RTBC
Comment #8
rajeshreeputraComment #10
rajeshreeputraMerged MR in 3.x branch.