The node_view_multiple() and comment_view_multiple() functions if given an empty array of nodes or comments respectively, will return a "non-empty" array:

  '#sorted' => TRUE,

I propose that these functions should return an empty array in this case as it's easier to check if the render array is actually empty rather than having to remember to use element_children() to know if its empty.


Dave Reid’s picture

This could also help minimally help performance since field_attach_prepare_view() and entity_prepare_view() can be skipped.

andypost’s picture

Issue summary:View changes
Status:Active» Closed (cannot reproduce)

Suppose they just fail now when no entities are passed in, see entity_view_multiple()