Function drupal_render treat following values as empty and returns empty string.
array('#markup' => 0);
array('#markup' => '0');
The problem comes when create list (numeric) field with possible value 0 and create node with this value. On full node view there is no value of this field shown at all.

CommentFileSizeAuthor
#3 902186-3.patch927 bytesygerasimov
#1 902186-1.patch789 bytesygerasimov

Comments

ygerasimov’s picture

Status: Active » Needs review
StatusFileSize
new789 bytes

please review the patch

moshe weitzman’s picture

Status: Needs review » Needs work

Needs code comments IMO

ygerasimov’s picture

Status: Needs work » Needs review
StatusFileSize
new927 bytes

patch with some comments

thedavidmeister’s picture

Status: Needs review » Closed (duplicate)

This looks like it was already fixed at some point in D7:

  // If #markup is set, ensure #type is set. This allows to specify just #markup
  // on an element without setting #type.
  if (isset($elements['#markup']) && !isset($elements['#type'])) {
    $elements['#type'] = 'markup';
  }