function CommentWidget::massageFormValues
Overrides WidgetBase::massageFormValues
File
-
core/
modules/ comment/ src/ Plugin/ Field/ FieldWidget/ CommentWidget.php, line 91
Class
- CommentWidget
- Provides a default comment widget.
Namespace
Drupal\comment\Plugin\Field\FieldWidgetCode
public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
// Add default values for statistics properties because we don't want to
// have them in form.
foreach ($values as &$value) {
$value += [
'cid' => 0,
'last_comment_timestamp' => 0,
'last_comment_name' => '',
'last_comment_uid' => 0,
'comment_count' => 0,
];
}
return $values;
}