*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\comment\CommentInterface::ANONYMOUS_MAYNOT_CONTACT instead.
+ *
+ * @see https://www.drupal.org/node/2831620
*/
const COMMENT_ANONYMOUS_MAYNOT_CONTACT = 0;
*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\comment\CommentInterface::ANONYMOUS_MAY_CONTACT instead.
+ *
+ * @see https://www.drupal.org/node/2831620
*/
const COMMENT_ANONYMOUS_MAY_CONTACT = 1;
*
* @deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.0.
* Use \Drupal\comment\CommentInterface::ANONYMOUS_MUST_CONTACT instead.
+ *
+ * @see https://www.drupal.org/node/2831620
*/
const COMMENT_ANONYMOUS_MUST_CONTACT = 2;
}
}
-/**
- * Implements hook_form_FORM_ID_alter() for 'field_storage_config_edit_form'.
- */
-function comment_form_field_storage_config_edit_form_alter(&$form, FormStateInterface $form_state) {
- if ($form_state->getFormObject()->getEntity()->getType() == 'comment') {
- // We only support posting one comment at the time so it doesn't make sense
- // to let the site builder choose anything else.
- $form['cardinality_container']['cardinality']['#default_value'] = 1;
- $form['cardinality_container']['#access'] = FALSE;
- }
-}
-
/**
* Implements hook_entity_storage_load().
*
if (!\Drupal::entityManager()->getDefinition($entity_type)->entityClassImplements(FieldableEntityInterface::class)) {
return;
}
- // @todo Investigate in https://www.drupal.org/node/2527866 why we need that.
- if (!\Drupal::hasService('comment.manager') || !\Drupal::service('comment.manager')->getFields($entity_type)) {
+ if (!\Drupal::service('comment.manager')->getFields($entity_type)) {
// Do not query database when entity has no comment fields.
return;
}
'#theme' => 'username',
'#account' => $account,
];
- $variables['author'] = drupal_render($username);
+ $variables['author'] = \Drupal::service('renderer')->render($username);
$variables['author_id'] = $comment->getOwnerId();
$variables['new_indicator_timestamp'] = $comment->getChangedTime();
$variables['created'] = format_date($comment->getCreatedTime());
'#theme' => 'username',
'#account' => $account_parent,
];
- $variables['parent_author'] = drupal_render($username);
+ $variables['parent_author'] = \Drupal::service('renderer')->render($username);
$variables['parent_created'] = format_date($comment_parent->getCreatedTime());
// Avoid calling format_date() twice on the same timestamp.
if ($comment_parent->getChangedTime() == $comment_parent->getCreatedTime()) {