Hi,

I'm building my own field, which is constituted by :

  • 1 textfield
  • 1 file
  • 1 textarea

I'd like to provide a wysiwyg editor for the textarea, so instead of textarea i tried to put text_format in my field definition (HOOK_field_widget_form).

But then I faced a lot of saving issues like non matching columns number...

I tried to had columns on my schema (like for a body field : body_value, body_format...) without success...

Do someone has a code snippet which shows how to do that?

Thanks.

Comments

DizzyC’s picture

It is possible that your problem is caused by the fact that the 'text_format' form element results in an array on submit.
So instead of having value and format in your values array after submitting the widget you will have an array (for the text_format element).
The array will contain value and format.

You will need to implement hook_field_presave and flatten the values array.

See this solution: http://drupal.org/node/1070258#comment-4515370