Hi,
I am developing my own field type.
It is using a text_format type textarea:
$element['content'] = array(
'#type' => 'text_format',
'#title' => t('Tab Content'),
'#default_value' => isset($items[$delta]['content_value']) ? $items[$delta]['content_value'] : NULL,
'#format' => $items[$delta]['format']) ? $items[$delta]['format'] : NULL,
);
So far so good. This makes a WYSIWYG editor appear.
Now when I try to save a node with this field, it gives me an error that the column and value count do not match.
After examining the error, I see that the query expects a field to store the selected format in. So I changed my schema to include the format, but then it just adds another value (empty) for that field, and still one value extra for the format. Still the same error.
My schema hook looks like this:
$schema['columns']['content'] = array(
'type' => 'text',
'not null' => FALSE,
);
$schema['columns']['format'] = array(
'type' => 'varchar',
'length' => '255',
'not null' => FALSE,
);
$schema['indexes'] = array(
'name' => array('name'),
'format' => array('format'),
);
$schema['foreign keys']['format'] = array(