Skip to content
Snippets Groups Projects
Commit a365b198 authored by Angie Byron's avatar Angie Byron
Browse files

#617596 follow-up by sun: optimize if statement.

parent 6c3f6337
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -170,13 +170,8 @@ function text_field_load($entity_type, $entities, $field, $instances, $langcode,
* Implements hook_field_is_empty().
*/
function text_field_is_empty($item, $field) {
if (empty($item['value']) && (string) $item['value'] !== '0') {
if ($field['type'] == 'text_with_summary') {
return (empty($item['summary']) && (string)$item['summary'] !== '0');
}
else {
return TRUE;
}
if (!isset($item['value']) || $item['value'] === '') {
return !isset($item['summary']) || $item['summary'] === '';
}
return FALSE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment