- Issue created by @fatima2345
I added poll as a field in a content type-let be 'Article'.Then output poll as a rendered entity wherever required.
Now I have created a view listing the content type with customization.Added a field for poll and displayed as rendered entity to show whole poll form.
Now my issue when i call the above poll field in Custom text in view,the poll is not rendered.If displaying directly there is noissue.Is there any way to fix this.
Tried to call in custom way.didnt work
In custom code tried below
$form = \Drupal::entityTypeManager()
->getFormObject('poll', 'default')
->setEntity($poll);
return \Drupal::formBuilder()->getForm($form);
Got below error
TypeError: Drupal\Core\Entity\EntityRepository::getTranslationFromContext(): Argument #1 ($entity) must be of type Drupal\Core\Entity\EntityInterface, null given, called in /modules/contrib/poll/src/Entity/Poll.php on line 401 in Drupal\Core\Entity\EntityRepository->getTranslationFromContext() (line 93 of /core/lib/Drupal/Core/Entity/EntityRepository.php)
Active
1.6
Code