diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php index c240fab..89386ca 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php @@ -80,10 +80,8 @@ public function viewElements(FieldItemListInterface $items) { } // Output the raw value in a content attribute if the text of the HTML // element differs from the raw value (for example when a prefix is used). - if ($item->value != $output) { - if (!empty($item->_attributes)) { - $item->_attributes += array('content' => $item->value); - } + if (!empty($item->_attributes) && $item->value != $output) { + $item->_attributes += array('content' => $item->value); } $elements[$delta] = array('#markup' => $output);