Wanna save text_format custom form in comment I'm using a custom form in CTools Modal to alter comment.

$form['subject'] = array(
   '#type' =&gt; 'textfield',
   '#title' =&gt; t('Title'),
   '#default_value' =&gt; $comment-&gt;subject,
);  
$form['comment_body'] = array(
   '#type' =&gt; 'text_format',
   '#default_value' =&gt; $comment-&gt;comment_body['und'][0]['value']
);


All is good. I get my comment title and my comment body which is pushed in ckeditor field. My submit : 

$comment = comment_load($form_state['values']['cid']);
$comment-&gt;comment_body['und'][0]['value'] = $form_state['values']['comment_body']['und'][0]['value'];
$comment-&gt;subject = $form_state['values']['title'];

comment_submit($comment);
comment_save($comment);


The subject is goodly saved from my form but for the body, it save an empty value.

Ps: when I change text_format for textfield, it work.
You forgot to add the format:

$comment-&gt;comment_body[LANGUAGE_NONE][0]['format'] = $form_state['values']['comment_body'][LANGUAGE_NONE][0]['format'];