If a content type has an entity reference that allows for multiple values, the custom formatter is only being run once, instead of for all selected values. If the Formatter is a Label or Rendered Entity, all selected values are being displayed, but once the Formatter is chosen to be a Custom Formatter, it is only executed once.

Comments

Vito Andolini’s picture

I tested this with a List (Integer) type, too, and the same behavior occurs (i.e. it's not isolated to entity references). Perhaps the content being rendered has a reference to a Node that contains the multiple values, and isn't aware that the referenced node has multiple values? I am pretty new to Drupal so just guessing...

But, if a custom formatter isn't used, the multiple values are all displayed, so there has to be a fix for this...

deciphered’s picture

Status: Active » Fixed

Formatters in Drupal 7 require you to handle the multiple values yourself, so it's up to you to implement a loop of some sort over all the items provided. Check out some of the examples provided or at http://customformatters.com

Automatically closed -- issue fixed for 2 weeks with no activity.