Drupal Association members fund grants that make connections all over the world.
Spin off from
Copied from over there:
Onceis done, widgets and formatters are going to be the only thing that work with the old style $items arrays for field values.
Aside from API consistency, avoiding that conversion / format change would probably be a performance win - especially since :
- all those methods are called through a single set of helpers : field_invoke_method() / field_invoke_method_multiple() (they currently work only on Field API fields, that would be changed by making the EntityDisplay responsible for rendering)
- some of those methods (Widget::extractFormValues() & Formatter::prepareView()) do some writing to the $items, and thus the invoke helpers currently do the job of assigning the array values back into the FieldItem objects - for *all* methods, since they don't carry any knowledge of which methods write to the values or not.
This dance between "new (FieldItem objects) native format for field values" and "old (array) format for field values handed to widgets / formatters" is very far from ideal performance wise, and it possibly only works right now because there's an EntityBC layer that we switch the $entity to before calling the field_invoke_method() / field_invoke_method_multiple() helpers that bridge to the widgets & formatters. But that BC layer is intended to go away at some point...
It shouldn't be a very complex task in itself, but doing it on all formatters and widgets affects a lot of code...
PASSED: [[SimpleTest]]: [MySQL] 57,447 pass(es). View
FAILED: [[SimpleTest]]: [MySQL] 57,515 pass(es), 8 fail(s), and 8 exception(s). View
PASSED: [[SimpleTest]]: [MySQL] 57,135 pass(es). View