Help with #text_format and field widgets I'm struggling with #type 'text_format' for a widget form field as this field gets expanded two separate elements, one holding the orignal element and the other the format selector. The orignal element is moved into a child element. 

All of this is fine, but as the orignal field is now moved into a child when the widget form is saved is tries to save the child element (array). As the widgets fields have to be at the root of the form with names that match 1:1 with db columns. 

From form.inc:


  If the property #text_format is set, the form element will be expanded into
  two separate form elements, one holding the content of the element, and the
  other holding the text format selector. The original element is shifted into
  a child element, but is otherwise unaltered, so that the format selector is
  at the same level as the text field which it affects.


I've looked at the text.module but I can't work out how it is getting around the issue of the field being expanded?
Good luck with that. What a head-scratching nightmare. See Missing hook_field_widget_form_submit()? for an idea of how to make this easier.

I got this to work once in a module, but then had to remove it for other reasons. The code is still there, look at this older version of flashcard.install and flashcard.module, especially flashcard_field_widget_form() and flashcard_field_formatter_view().