Error on /admin/localization/translation-history page
Not sure if it's my database which is in a weird state but it wouldn't hurt to check for the field value in that method.
\Drupal\l10n_server\Entity\L10nServerTranslationHistory::getActionUid
The website encountered an unexpected error. Please try again later.
Error: Call to a member function getValue() on null in Drupal\l10n_server\Entity\L10nServerTranslationHistory->getActionUid() (line 230 of modules/contrib/l10n_server/l10n_server/src/Entity/L10nServerTranslationHistory.php).
Drupal\l10n_server\Entity\L10nServerTranslationHistory->getActionUid() (Line: 48)
Drupal\l10n_server\Entity\ListBuilder\L10nServerTranslationHistoryListBuilder->buildRow(Object) (Line: 219)
Drupal\Core\Entity\EntityListBuilder->render() (Line: 18)
Drupal\l10n_server\Entity\ListBuilder\L10nServerTranslationHistoryListBuilder->render() (Line: 23)
Drupal\Core\Entity\Controller\EntityListController->listing('l10n_server_translation_history')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
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: 159)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
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: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | l10n_server-translation-history-3311405-2.diff | 1.58 KB | sutharsan |
Comments
Comment #2
sutharsan commentedAll getters of the L10nServerTranslationHistory entity have the same potential problem. This patch fixes them in the same manner.
Comment #3
sutharsan commentedThe fault can happen on all entity properties that have NULL as default value and have the same code construction in the getter:
$this->get('foo')->first()->getValue()['value'];Comment #5
fmb commentedThanks for your help @Sutharsan, much appreciated!
Comment #6
sutharsan commentedI've created a follow-up for the remaining entities: #3347271: Prevent error on entity getters
Comment #7
sutharsan commentedComment #8
fmb commented