Hey,
I am trying to build a custom field that have a few fields. one of thous field need to be a wysiwyg field.
I can make the wyiswyg to be shown in the form using the next code (in my hook_field_widget_form):
$element['my_body'] = array(
'#title' => t('Editor'),
'#type' => 'text_format',
'#tree' => true,
'#rows' => 10,
'#format' => 'filtered_html',
);
But after i save the node, i get error (because of the added fields of the wysiwyg (foramt and value):
PDOException: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1: INSERT INTO {field_data_field_mymodule} (entity_type, entity_id, revision_id, bundle, delta, language, field_mymodule_title, field_mymodule_body, field_mymodule_format) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7_value, :db_insert_placeholder_7_format, :db_insert_placeholder_8); Array
(
[:db_insert_placeholder_0] = node
[:db_insert_placeholder_1] = 16
[:db_insert_placeholder_2] = 16
[:db_insert_placeholder_3] = BarakTEST
[:db_insert_placeholder_4] = 0
[:db_insert_placeholder_5] = he