I’m trying to port a theme from Drupal 6 to Drupal 8, and I find code like the following.
$edit = array(); $edit['nid'] = $node->nid; $form = drupal_get_form('comment_form', $edit));
How do I load the form in Drupal 8? I get the following error:
Fatal error: Call to a member function getEntityTypeId() on null in /www/site/core/lib/Drupal/Core/Entity/EntityForm.php on line 77
The line causing the error is the following one:
Drupal::formBuilder()->getForm('DrupalcommentCommentForm');
I can’t work out how to pass the node object to the form builder. How can I do it?