- Issue created by @elaman
After update, when you visit courses page on multi-lang website, you get following error:
InvalidArgumentException: Field field_course_module is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField() (line 618 of core/lib/Drupal/Core/Entity/ContentEntityBase.php).
Drupal\Core\Entity\ContentEntityBase->get() (Line: 291)
Drupal\anu_lms\Course->getLessonsAndQuizzesUrls() (Line: 27)
Drupal\anu_lms\Normalizer\CourseNormalizer->normalize() (Line: 161)
Symfony\Component\Serializer\Serializer->normalize() (Line: 169)
Drupal\anu_lms\Normalizer->normalizeEntity() (Line: 294)
Drupal\anu_lms\Plugin\AnuLmsContentType\CoursesLandingPage->getData() (Line: 110)
Drupal\anu_lms\Controller\AnulmsNodeViewController->view()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
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: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 173)
Drupal\purge_queuer_url\StackMiddleware\UrlRegistrar->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 124)
Drupal\cloudflare\CloudFlareMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)
Config a multi-lang website, enable Anu LMS and visit Courses page.
Add bundle check or a field check.
Needs work
2.11
Code