Skip to content

Instantly share code, notes, and snippets.

@init90
Created December 5, 2019 10:54
Show Gist options
  • Save init90/11c59d4e57be44a929b8f7590f1bdde7 to your computer and use it in GitHub Desktop.
Save init90/11c59d4e57be44a929b8f7590f1bdde7 to your computer and use it in GitHub Desktop.
Drupal 8, get commented entity from comment form.
$comment = $form_state->getFormObject()->getEntity();
$submission = $comment->getCommentedEntity();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment