Commit ee0b5439 authored by alexpott's avatar alexpott
Browse files

Issue #2390013 by andypost: Follow-up comment widget should properly detect default value input

parent 22ca1c9c
......@@ -54,7 +54,7 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
// If the entity doesn't have any comments, the "hidden" option makes no
// sense, so don't even bother presenting it to the user unless this is the
// default value widget on the field settings form.
if ($element['#field_parents'] != array('default_value_input') && !$items->comment_count) {
if (!$this->isDefaultValueWidget($form_state) && !$items->comment_count) {
$element['status'][CommentItemInterface::HIDDEN]['#access'] = FALSE;
// Also adjust the description of the "closed" option.
$element['status'][CommentItemInterface::CLOSED]['#description'] = t('Users cannot post comments.');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment